Skip to content

rgbClamp

rgbClamp(v): RgbCoords

Defined in: packages/math-color/src/models/rgb.ts:24

Clamps each channel of an RgbCoords to the normalised range [0, 1].

The caller is responsible for ensuring the input uses the [0, 1] convention (gamma-encoded or linear-light). Achromatic clipping can shift hue for out-of-gamut colours; use gamut mapping (lab-map-to-gamut) when that matters.

RgbCoords

RgbCoords