colorReplace
colorReplace(
inputColor,targetColor,replaceColor,tolerance):Node<"vec4">
Defined in: packages/nodes/src/retro/colorReplace.ts:23
Replace a target color with a new color. Uses smooth tolerance for anti-aliased sprites (smooth falloff at edges).
Parameters
inputColor
Node<"vec4">
The input color (vec4 with alpha)
targetColor
Color to find and replace (RGB tuple or vec3 node)
replaceColor
Color to replace with (RGB tuple or vec3 node)
tolerance
FloatInput = 0.1
Match tolerance (default: 0.1)
Returns
Node<"vec4">
Color with replacement applied
Examples
// Swap red for bluecolorReplace(color, [1, 0, 0], [0, 0, 1], 0.1)// Create team color variants with uniformcolorReplace(color, baseColor, teamColorUniform, 0.15)