Skip to content

labMapToGamut

labMapToGamut(lab, whitePoint, rgbProfile): LabD50

Defined in: packages/math-color/src/lab-map-to-rgb-gamut.ts:30

Maps a CIE L_a_b* color into the gamut of the given RGB profile using the CSS Color Level 4 chroma-reduction method: binary search on C* while preserving L* and h°.

If the color is already in gamut it is returned unchanged. If C* ≤ 0 (achromatic), the input is returned as-is (per-channel clamping is the correct fallback in that case).

LabD50

The CIE L_a_b* color to map into gamut.

XyzNormalized

The reference white point of the CIE L_a_b* color.

RgbProfile

The target RGB color space profile.

LabD50

A CIE L_a_b* color guaranteed to map to a linear RGB value within [0, 1] per channel.