quantizeRGB
quantizeRGB(
inputColor,rLevels,gLevels,bLevels):Node<"vec4">
Defined in: packages/nodes/src/retro/quantize.ts:54
Quantize color with different levels for each RGB channel. Useful for specific retro palettes like 3-3-2 (8-bit color).
Parameters
Section titled “Parameters”inputColor
Section titled “inputColor”Node <"vec4">
The input color (vec4 with alpha)
rLevels
Section titled “rLevels”Number of levels for red channel
gLevels
Section titled “gLevels”Number of levels for green channel
bLevels
Section titled “bLevels”Number of levels for blue channel
Returns
Section titled “Returns”Node <"vec4">
Quantized color
Examples
Section titled “Examples”// 8-bit color (3-3-2 format: 8R, 8G, 4B)quantizeRGB(color, 8, 8, 4)// 16-bit high color (5-6-5 format)quantizeRGB(color, 32, 64, 32)