Skip to content

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).

Node <"vec4">

The input color (vec4 with alpha)

FloatInput

Number of levels for red channel

FloatInput

Number of levels for green channel

FloatInput

Number of levels for blue channel

Node <"vec4">

Quantized color

// 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)