colorReplaceMultiple
colorReplaceMultiple(
inputColor,sourceColors,targetColors,tolerance?):Node<"vec4">
Defined in: packages/nodes/src/retro/colorReplace.ts:110
Replace multiple colors at once (palette swap). Each source color maps to a corresponding target color.
Parameters
Section titled “Parameters”inputColor
Section titled “inputColor”Node <"vec4">
The input color (vec4 with alpha)
sourceColors
Section titled “sourceColors”[number, number, number][]
Array of colors to find (RGB tuples)
targetColors
Section titled “targetColors”[number, number, number][]
Array of colors to replace with (RGB tuples)
tolerance?
Section titled “tolerance?”FloatInput = 0.1
Match tolerance (default: 0.1)
Returns
Section titled “Returns”Node <"vec4">
Color with all replacements applied
Example
Section titled “Example”// Swap entire character palettecolorReplaceMultiple( color, [[1, 0, 0], [0, 1, 0], [0, 0, 1]], // Source: red, green, blue [[1, 0.5, 0], [0, 0.5, 0], [0.5, 0, 1]], // Target: orange, dark green, purple 0.15)