From c7f6b3d1cd3992b59af32a460c22f2574935b3b2 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Sat, 5 Apr 2025 12:33:06 +0100 Subject: grid --- src/index.html.in | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/index.html.in') diff --git a/src/index.html.in b/src/index.html.in index fcfb8ef..bd4343d 100644 --- a/src/index.html.in +++ b/src/index.html.in @@ -65,12 +65,15 @@ async function main() { let len = dl[0]; let ops = dl.subarray(1); + console.log(new Uint32Array(ops.subarray(6, 12))); for (let i = 0; i < len; i++) { - let op = ops.subarray(5*i, 5*i+5); - const color = new Uint8Array(new Uint32Array(ops.subarray(4, 5)).buffer); - let style = `#${color[0].toString(16).padStart(2, "0")}${color[1].toString(16).padStart(2, "0")}${color[2].toString(16).padStart(2, "0")}`; - ctx.fillStyle = style; + let op = ops.subarray(6*i, 6*i+6); + const color = new Uint8Array(new Uint32Array(ops.subarray(4, 6)).buffer); + ctx.fillStyle = `#${color[0].toString(16).padStart(2, "0")}${color[1].toString(16).padStart(2, "0")}${color[2].toString(16).padStart(2, "0")}`; + // console.log(color); ctx.fillRect(op[0], op[1], op[2], op[3]); + ctx.strokeStyle = `#${color[4].toString(16).padStart(2, "0")}${color[5].toString(16).padStart(2, "0")}${color[6].toString(16).padStart(2, "0")}`; + ctx.strokeRect(op[0], op[1], op[2], op[3]); } } -- cgit v1.2.3