function

lab() — CSS reference

CIE Lab describes lightness and two opponent-color axes using a D50 reference white. Positive a tends toward red and negative a toward green; positive b tends toward yellow and negative b toward blue. Unlike HSL, lightness is intended to approximate perceptual lightness, but uniformity is imperfect.

Formal Syntax & Structure

css syntaxcss
lab(L a b [ / alpha ])

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS color lab</title><style>body {margin:0} .sample {height:12px;background:#006050}p {padding:12px;background:white;color:black;border:2px solid currentColor} #a{color:lab(50% 20 -30)} #b{color:lab(50 0 0)}
</style><body><p id="a">First color sample</p><p id="b">Second color sample</p></body></html>
CSS Reference