diff options
Diffstat (limited to 'src/index.html.in')
-rw-r--r-- | src/index.html.in | 11 |
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]); } } |