Blends two colors to find a third color between them.
The amt parameter specifies the amount to interpolate between the two values. 0 is equal to the first color, 0.1 is very near the first color, 0.5 is halfway between the two colors, and so on. Negative numbers are set to 0. Numbers greater than 1 are set to 1. This differs from the behavior of lerp. It's necessary because numbers outside of the interval [0, 1] will produce strange and unexpected colors.
The way that colors are interpolated depends on the current colorMode() or on the passed options object.
Normally, colors are interpolated according to the current colorMode(). But you can override this by specifying a different color space to perform the interpolation in. Different color spaces will blend colors differently.
In p5.strands shader callbacks, lerpColor() interpolates between vec4 colors and returns a normalized vec4 with RGBA components in the 0–1 range. colorMode() has no effect inside shader callbacks.
Examples
Syntax
lerpColor(c1, c2, amt)
lerpColor(c1, c2, options)