set method
void
set(
{ - required int x,
- required int y,
- required Color color,
})
Implementation
void set({
required int x,
required int y,
required Color color,
}) {
if (pixels == null) {
throw Exception('Must call loadPixels() before calling updatePixels()');
}
final pixelIndex = _getBitmapPixelOffset(
imageWidth: _paintingContext.size.width.round(),
x: x,
y: y,
);
final argbColorInt = color.value;
final rgbaColorInt = ((argbColorInt & 0xFF000000) >> 24) | ((argbColorInt & 0x00FFFFFF) << 8);
pixels!.setUint32(pixelIndex, rgbaColorInt);
}