Reference lerpColor()

lerpColor()

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().

Examples

Syntax

lerpColor(c1, c2, amt)

Parameters

c1

interpolate from this color.

c2

interpolate to this color.

amt

number between 0 and 1.

Notice any errors or typos? Please let us know. Please feel free to edit src/color/creating_reading.js and open a pull request!

Related References