I have a certain amount of squares with the width and height of 40, Is there any way to fit them "perfectly" into an image generated with node-canvas without the image being too big or too small? Also making the image size balanced so that there is not too much squares on the width or too much on the height.
Here is what I have tried:
let b = ((accent.length + other.length + 1) * 40); // the amount of squares * 40 (width/height)
let canvas = new Canvas(b, b);
and:
let b = ((accent.length + other.length + 1) * 40) / 2; // the amount of squares * 40 (width/height)
let canvas = new Canvas(b, b);
But that either just makes the image too big or too small.