Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/css-color/oklab-l-almost-1.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: OKLab and OKLCH</title>
<link rel="match" href="oklab-l-almost-1-ref.html">
<meta name="assert" content="oklab() with lightness very close to 1 should render the same as 1">
<style>
    .square { border: 1px solid black; width: 200px; height: 200px; }
    .test { background-color: red; height: 100px; }
    /* Non-zero a/b is used to show if the result is white or not, but the
     * test passes as long as it's the same color. */
    .ref { background-color: oklab(1 0.15 0.15); height: 100px; }
    .test { background-color: oklab(99.9999% 0.15 0.15); }
</style>
<body>
    <p>Test passes if you see a square border with a single color inside.</p>
    <div class="square">
        <div class="ref"></div>
        <div class="test"></div>
    </div>
</body>