colour.algebra.lerp#

colour.algebra.lerp(x: ArrayLike, a: ArrayLike = 0, b: ArrayLike = 1, clip: bool = False) NDArrayFloat#

Perform linear interpolation between specified arrays \(a\) and \(b\) using array \(x\).

Parameters:
  • x (ArrayLike) – Array \(x\) containing values to use for interpolation between array \(a\) and array \(b\).

  • a (ArrayLike) – Array \(a\), the start of the interpolation range.

  • b (ArrayLike) – Array \(b\), the end of the interpolation range.

  • clip (bool) – Whether to clip the output values to range [\(a\), \(b\)].

Returns:

Linear interpolation result.

Return type:

numpy.ndarray

Examples

>>> a = 0
>>> b = 2
>>> linstep_function(0.5, a, b)
1.0