diff --git a/html/js/mobile-automata.mjs b/html/js/mobile-automata.mjs index 8e2caa5..d53235a 100644 --- a/html/js/mobile-automata.mjs +++ b/html/js/mobile-automata.mjs @@ -295,6 +295,9 @@ export function renderToCanvas(canvas, width, height, sn = 0, dn = 0) { const img = ctx.createImageData(width, height); const data = img.data; + const colorOn = [0, 0, 139]; // dark blue (active cell) + const colorOff = [0, 0, 70]; // darker blue (inactive cell) + for (let y = 0; y < height; y++) { for (let x = 0; x < width; x++) { const idx = (y * width + x) * 4; @@ -307,9 +310,6 @@ export function renderToCanvas(canvas, width, height, sn = 0, dn = 0) { } } - const colorOn = [0, 0, 139]; // dark blue (active cell) - const colorOff = [0, 0, 70]; // darker blue (inactive cell) - ctx.putImageData(img); function step() {