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).
Parameters
Section titled “Parameters”The CIE L_a_b* color to map into gamut.
whitePoint
Section titled “whitePoint”The reference white point of the CIE L_a_b* color.
rgbProfile
Section titled “rgbProfile”The target RGB color space profile.
Returns
Section titled “Returns”A CIE L_a_b* color guaranteed to map to a linear RGB value within [0, 1] per channel.