palettize
palettize(
inputColor,paletteTex,strength?):Node<"vec4">
Defined in: packages/nodes/src/retro/palettize.ts:31
Map colors to nearest match in a palette texture. Palette should be a 1D horizontal texture (Nx1 pixels).
This function samples the palette by computing the luminance of the input color and using it to index into the palette texture.
Parameters
Section titled “Parameters”inputColor
Section titled “inputColor”Node <"vec4">
The input color (vec4 with alpha)
paletteTex
Section titled “paletteTex”Palette texture (horizontal strip)
strength?
Section titled “strength?”FloatInput = 1
Effect strength (0 = original, 1 = fully palettized)
Returns
Section titled “Returns”Node <"vec4">
Color snapped to palette
Examples
Section titled “Examples”// Apply GameBoy palettepalettize(color, gbPaletteTexture)// Partial palette effectpalettize(color, retroPalette, 0.5)