Skip to content

createColorRamp

createColorRamp(stops): ColorRamp

Defined in: packages/math-color/src/color-ramp.ts:27

Builds a ramp interpolating between control points, evenly spaced.

Interpolation is in OKLab, which is why the stops are: mixing sRGB darkens through the middle of a hue transition, and mixing in a cylindrical space needs a hue policy this deliberately does not have.

O(1) per sample — the segment is found by arithmetic, not by scanning.

readonly Oklab[]

At least two, in ramp order.

ColorRamp

When fewer than two stops are given.