From dca193a82300b79a9b983ee1b9b744adb68f7d5c Mon Sep 17 00:00:00 2001 From: awesomeuser Date: Fri, 4 Aug 2023 17:56:29 +0000 Subject: [PATCH] Update index.php --- index.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index f28087b..b7dd9de 100644 --- a/index.php +++ b/index.php @@ -100,13 +100,12 @@ const canvas = document.getElementById(canvasId); const ctx = canvas.getContext("2d"); - // const pen = ctx.createImageData(2, 2); - // for (let i = 0; i < pen.data.length; i += 4) { - // pen.data[i] = 0; - // pen.data[i+1] = 0; - // pen.data[i+2] = 0; - // pen.data[i+3] = 255; - // } + const copy = ctx.createImageData(128, 64); + for (let i = 0; i < pen.data.length; i++) { + copy.data[(i*4)+3] = 255; + } + + ctx.putImageData(copy, 0, 0); }