import { paintGlowPixels } from '@datamoc/mwg/two-d/render';
const size = 5;
const pixels = new Uint8ClampedArray(size * size * 4);
paintGlowPixels(pixels, size, { color: 0xff0000, radius: 2, intensity: 1 });
console.log(pixels[0] > pixels[pixels.length - 4]); // true - the centre burns redder than the rim
Paint a
size * sizeradial glow (the sprite is square,sizeis odd) intopixelsas RGBA bytes. Centre pixels carry the colour at full intensity, rim pixels fade to transparent, and intensity scales every channel linearly, so doubling it doubles the light. Pure, likepaintFogPixels.