colorReplaceHard
colorReplaceHard(
inputColor,targetColor,replaceColor,tolerance?):Node<"vec4">
Defined in: packages/nodes/src/retro/colorReplace.ts:64
Replace a target color with a new color using hard cutoff (no blending). Good for pixel art with exact color matching.
Parameters
Section titled “Parameters”inputColor
Section titled “inputColor”Node <"vec4">
The input color (vec4 with alpha)
targetColor
Section titled “targetColor”Color to find and replace (RGB tuple or vec3 node)
replaceColor
Section titled “replaceColor”Color to replace with (RGB tuple or vec3 node)
tolerance?
Section titled “tolerance?”FloatInput = 0.01
Match tolerance (default: 0.01)
Returns
Section titled “Returns”Node <"vec4">
Color with replacement applied
Example
Section titled “Example”// Exact color swap for pixel artcolorReplaceHard(color, [1, 0, 0], [0, 0, 1], 0.01)