kotlinx-browser icon indicating copy to clipboard operation
kotlinx-browser copied to clipboard

Uint8ClampedArray declaration unusable

Open JSMonk opened this issue 1 month ago • 0 comments

org.khronos.webgl.Uint8ClampedArray getter and setter declarations use Byte. Which means assigning values over 127 to it is not trivial. Also the values obtained from it violate the Byte contract

Besides one could argue that it is not a "real" array. Assigning values outside of 0..255 range is completely normal for it.

This case is important, because it is used for the canvas manipulation: https://developer.mozilla.org/en-US/docs/Web/API/ImageData/data

More information here: https://youtrack.jetbrains.com/issue/KT-24583

JSMonk avatar Nov 10 '25 15:11 JSMonk