Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test oklab()/oklch() with with lightness close to 0/1
This is an interop issue where Chrome's behavior is different from Firefox and Safari's: https://crbug.com/329106317 These tests don't care what the color is, as long as it is the same.
- Loading branch information
Showing
8 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<style> | ||
.ref { background-color: oklab(0 0.15 0.15); width: 12em; height: 12em; } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!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> | ||
.test { background-color: red; width: 12em; height: 6em; } | ||
/* 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); width: 12em; height: 6em; } | ||
.test { background-color: oklab(0.0001% 0.15 0.15); } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
<div class="test"></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<style> | ||
.ref { background-color: oklab(1 0.15 0.15); width: 12em; height: 12em; } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!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> | ||
.test { background-color: red; width: 12em; height: 6em; } | ||
/* 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(1 0.15 0.15); width: 12em; height: 6em; } | ||
.test { background-color: oklab(99.9999% 0.15 0.15); } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
<div class="test"></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<style> | ||
.ref { background-color: oklch(0 0.2 45); width: 12em; height: 12em; } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!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> | ||
.test { background-color: red; width: 12em; height: 6em; } | ||
/* 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); width: 12em; height: 6em; } | ||
.test { background-color: oklch(0.0001% 0.2 45); } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
<div class="test"></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<style> | ||
.ref { background-color: oklch(1 0.2 45); width: 12em; height: 12em; } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!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> | ||
.test { background-color: red; width: 12em; height: 6em; } | ||
/* 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); width: 12em; height: 6em; } | ||
.test { background-color: oklch(99.9999% 0.2 45); } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single color.</p> | ||
<div class="ref"></div> | ||
<div class="test"></div> | ||
</body> |