let pixelGridColor = "#0000FF"; let lineDistance = 12; pixelGridCanvas = document.getElementById("pixel-grid"); function fillPixelGrid() { let context = pixelGridCanvas.getContext("2d"); let originalSize = layers[0].canvasSize; pixelGridCanvas.width = originalSize[0] * lineDistance; pixelGridCanvas.height = originalSize[1] * lineDistance; // OPTIMIZABLE, could probably be a bit more elegant // Draw horizontal lines for (let i=0; i