interpolateColor(node: Node, { inputRange, outputRange }: ColorInterpolationConfig, [colorSpace = "rgb"]): Node

Interpolate colors based on an animation value and its value range.

interpolateColor(value: Node, { inputRange: number[], outputRange: Colors }, colorSpace?: "hsv" | "rgb"): Node

Example Usage:

const from = { r: 197, g: 43, b: 39 };
const to = { r: 225, g: 176, b: 68 };
// Interpolate in RGB color space (default)
interpolateColor(node, {
inputRange: [0, 100],
outputRange: [from, to]
});
// Interpolate in HSV color space
interpolateColor(
clampedScroll,
{
inputRange: [0, 1],
outputRange: [from, to]
},
"hsv"
);

HEX colors will be automatically converted to RGB

interpolateColor(node, {
inputRange: [0, 100],
outputRange: ["#c52c27", "#e1b044"]
});
// with alpha
interpolateColor(node, {
inputRange: [0, 100],
outputRange: ["#c52c2700", "#c52c27ff"]
});