lab()
The lab()
functional notation expresses a given color in the CIE L*a*b* color space. Lab represents the entire range of color that humans can see.
Syntax
lab(29.2345% 39.3825 20.0664); lab(52.2345% 40.1645 59.9971); lab(52.2345% 40.1645 59.9971 / .5);
Values
- Functional notation:
lab(L a b [/ A])
-
L
specifies the CIE Lightness, and is a<percentage>
between0%
representing black and100%
representing white.The second argument
a
is the distance along thea
axis in the Lab colorspace.The third argument
b
is the distance along theb
axis in the Lab colorspace.A
(alpha) can be a<number>
between0
and1
, or a<percentage>
, where the number1
corresponds to100%
(full opacity).
Specificatiions
Specification |
---|
CSS Color Module Level 4 (CSS Color 4) # lab-colors |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
lab() |
No |
No |
No |
No |
No |
15 |
No |
No |
No |
No |
15 |
No |
See also
- LCH colors in CSS: what, why, and how?
-
Safari Technology Preview 122 release notes: includes
lab()
andlch()
colors.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/lab()