lerp
Linearly interpolates between start and end by the factor t.
t = 0returnsstart.t = 1returnsend.- Values of
toutside[0, 1]extrapolate beyond the range.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
start | number | The start value. |
end | number | The end value. |
t | number | The interpolation factor. |
Returns
Section titled “Returns”number — The interpolated value.
Examples
Section titled “Examples”Interpolate between two values
Section titled “Interpolate between two values”Returns the value between start and end at position t (0 = start, 1 = end).
Animate a colour channel
Section titled “Animate a colour channel”t outside [0, 1] extrapolates beyond the range.
