Skip to content

Commit

Permalink
CSS Colors: Test hsl() and hwb() with angle units
Browse files Browse the repository at this point in the history
We add WPTs using deg, grad, rad and turn units with color functions.

Change-Id: Ib55ef4717be03b6ce353e4446be4e96d899232f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3915706
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1051129}
  • Loading branch information
ericwilligers authored and chromium-wpt-export-bot committed Sep 26, 2022
1 parent 9d6e7f8 commit ff5f12e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions css/css-color/parsing/color-valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
test_valid_value("color", "hwb(none 100% 50% / none)", "rgba(170, 170, 170, 0)");
test_valid_value("color", "hwb(0 100% 50% / 0)", "rgba(170, 170, 170, 0)");

test_valid_value("color", "hsl(72deg 22% 77%)", "rgb(204, 209, 183)");
test_valid_value("color", "hwb(160grad 30% 17%)", "rgb(77, 212, 131)");
test_valid_value("color", "hsl(3.77rad 43% 24%)", "rgb(35, 56, 88)");
test_valid_value("color", "hwb(0.8turn 29% 6%)", "rgb(207, 74, 240)");

for (const colorSpace of [ "srgb", "srgb-linear", "a98-rgb", "rec2020", "prophoto-rgb", "display-p3" ]) {
test_valid_value("color", `color(${colorSpace} 0% 0% 0%)`, `color(${colorSpace} 0 0 0)`);
Expand Down

0 comments on commit ff5f12e

Please sign in to comment.