interpolateHcl
fun interpolateHcl(type: Expression<InterpolationValue>, input: Expression<FloatValue>, vararg stops: Pair<Number, Expression<ColorValue>>): Expression<ColorValue>(source)
Produces continuous, smooth results by interpolating between pairs of input and output values (stops), given the input value. Works like interpolate, but the interpolation is performed in the Hue-Chroma-Luminance color space.
Requires the type of interpolation to use. Use linear, exponential, or cubicBezier.
Example:
interpolateHcl(
linear(),
zoom(),
1 to const(Color.Red),
5 to const(Color.Blue),
10 to const(Color.Green)
)
Content copied to clipboard
interpolates linearly from red to blue between in zoom levels 1 to 5, then interpolates linearly from blue to green in zoom levels 5 to 10, which it where it remains until maximum zoom.