setPixelRgba method
Set the pixel at the given x
, y
coordinate to the color
r
, g
, b
, a
.
This simply replaces the existing color, it does not do any alpha
blending. Use drawPixel
for that. No range checking is done.
Implementation
void setPixelRgba(int x, int y, int r, int g, int b, [int a = 0xff]) {
data[y * width + x] = getColor(r, g, b, a);
}