canvas, the color value of rgba obtained by getimagedata is not correct
< hr > let canvas = document.querySelector ("- sharpcanvas");
let cxt = canvas.getContext ("2d");
let imageData = cxt.createImageData (2d2);
for (var iTuno (I < imageData.data.length;i+=4) {
imageData.data[i+0]=64;
imageData.data[i+1]=55;
imageData.data[i+2]=235;
imageData.data[i+3]=133;
}
cxt.putImageData (imageData,0,0)
then getImageData
0:63
1:56
236
3
.
this is the result of running under chrome, and the result under firefox is not the same
is really crazy. I need accurate color values in my business, so I can"t do it at all.
who knows why or what the solution is