Can someone please explain why does canvas does not obey color choice and how to fix it so it draw in "true" colors? I know canvas is using 0.5 pixel coordinates, so I've tried draw using 0.5 increments, but it still draw with funky colors (using ColorCop to zoom in and check colors per pixel:
Here is a little snippet that supposed to draw blue lines, 2 lines next to each other and third line 1 pixel away, the result is only first line has true blue everything else is purple or worse, including first/last pixel of first line:
const canvas = document.getElementById("line"),
ctx = canvas.getContext("2d");
canvas.width = canvas.height = 100;
ctx.strokeStyle = 'blue';
ctx.lineCap = "square";
ctx.imageSmoothingEnabled = false;
ctx.moveTo(10.5, 40.5);
ctx.lineTo(80.5, 40.5);
ctx.moveTo(10.5, 41.5);
ctx.lineTo(80.5, 41.5);
ctx.moveTo(10.5, 43.5);
ctx.lineTo(80.5, 43.5);
ctx.stroke();
<canvas id="line"></canvas>
My monitor resolution is 2560x1440 with 100% scaling. No system/browser/software or any kind of zoom/scale is used. If I draw a pixel in MS Paint, I see one pixel on the monitor no antialiasing, no artifacts.