Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test oklab()/oklch() with lightness close to 0/1 #45073

Merged
merged 1 commit into from Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions css/css-color/oklab-l-almost-0-ref.html
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.ref { background-color: oklab(0 0.15 0.15); border: 1px solid black; width: 200px; height: 200px; }
</style>
<body>
<p>Test passes if you see a square border with a single color inside.</p>
<div class="ref"></div>
</body>
21 changes: 21 additions & 0 deletions css/css-color/oklab-l-almost-0.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: OKLab and OKLCH</title>
<link rel="help" href="https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch">
<link rel="match" href="oklab-l-almost-0-ref.html">
<meta name="assert" content="oklab() with lightness very close to 0 should render the same as 0">
<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 black or not, but the
* test passes as long as it's the same color. */
.ref { background-color: oklab(0 0.15 0.15); height: 100px; }
.test { background-color: oklab(0.0001% 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>
9 changes: 9 additions & 0 deletions css/css-color/oklab-l-almost-1-ref.html
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.ref { background-color: oklab(1 0.15 0.15); border: 1px solid black; width: 200px; height: 200px; }
</style>
<body>
<p>Test passes if you see a square border with a single color inside.</p>
<div class="ref"></div>
</body>
21 changes: 21 additions & 0 deletions css/css-color/oklab-l-almost-1.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: OKLab and OKLCH</title>
<link rel="help" href="https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch">
<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>
9 changes: 9 additions & 0 deletions css/css-color/oklch-l-almost-0-ref.html
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.ref { background-color: oklch(0 0.2 45); border: 1px solid black; width: 200px; height: 200px; }
</style>
<body>
<p>Test passes if you see a square border with a single color inside.</p>
<div class="ref"></div>
</body>
21 changes: 21 additions & 0 deletions css/css-color/oklch-l-almost-0.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: OKLab and OKLCH</title>
<link rel="help" href="https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch">
<link rel="match" href="oklch-l-almost-0-ref.html">
<meta name="assert" content="oklch() with lightness very close to 0 should render the same as 0">
<style>
.square { border: 1px solid black; width: 200px; height: 200px; }
.test { background-color: red; height: 100px; }
/* Non-zero chroma is used to show if the result is black or not, but the
* test passes as long as it's the same color. */
.ref { background-color: oklch(0 0.2 45); height: 100px; }
.test { background-color: oklch(0.0001% 0.2 45); }
</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>
9 changes: 9 additions & 0 deletions css/css-color/oklch-l-almost-1-ref.html
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.ref { background-color: oklch(1 0.2 45); border: 1px solid black; width: 200px; height: 200px; }
</style>
<body>
<p>Test passes if you see a square border with a single color inside.</p>
<div class="ref"></div>
</body>
21 changes: 21 additions & 0 deletions css/css-color/oklch-l-almost-1.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: OKLab and OKLCH</title>
<link rel="help" href="https://drafts.csswg.org/css-color-4/#specifying-oklab-oklch">
<link rel="match" href="oklch-l-almost-1-ref.html">
<meta name="assert" content="oklch() 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 chroma 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: oklch(1 0.2 45); height: 100px; }
.test { background-color: oklch(99.9999% 0.2 45); }
</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>