pub struct Lab;
Expand description
🌌 The CIELAB color space
The CIE L*a*b* color space was created in 1976 to be more perceptually uniform than RGB color spaces, and is both widely used and the basis of other efforts to express colors, including FreieFarbe.
Its components are [L, a, b]
with
L
- the lightness with a natural bound between 0 and 100, where 0 represents pure black and 100 represents the lightness of white;a
- how green/red the color is; andb
- how blue/yellow the color is.
a
and b
are unbounded, but are usually between -160 and 160.
The color space has poor hue linearity and hue uniformity compared with Oklab, though superior lightness uniformity. Note that the lightness range differs from Oklab as well; in Oklab white has a lightness of 1.
The CIE L*a*b* color space is defined in terms of a D50 white point. For conversion between color spaces with other illuminants (especially D65 as in sRGB), the standard Bradform linear chromatic adaptation transform is used.
This corresponds to the color space in CSS Color Module Level 4 § 9.1 .
Lab has a cylindrical counterpart: Lch.