Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/src/index.html.in
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2025-04-05 12:33:06 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2025-04-05 12:33:06 +0100
commitc7f6b3d1cd3992b59af32a460c22f2574935b3b2 (patch)
treee9270826d5384e9db47dcdfd73b97d7a47088773 /src/index.html.in
parent935f69ca25bca24fd36166e7192ebb69af2d35e9 (diff)
downloadldjam57-c7f6b3d1cd3992b59af32a460c22f2574935b3b2.tar
grid
Diffstat (limited to 'src/index.html.in')
-rw-r--r--src/index.html.in11
1 files changed, 7 insertions, 4 deletions
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]);
}
}