function
oklab() — CSS reference
Oklab is a perceptual color model with a lightness coordinate and two opponent axes, using a D65 white point. Its numeric lightness reference range is 0 to 1, unlike Lab’s 0 to 100. Oklab improves perceptual consistency but does not guarantee identical appearance or accessible contrast.
Formal Syntax & Structure
css syntaxcss
oklab(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:oklab(60% 0.1 -0.1)} #b{color:oklab(0.6 0 0)}
</style><body><p id="a">First color sample</p><p id="b">Second color sample</p></body></html>