Issue #3003 - Add CSS lch() color parsing support

This commit is contained in:
Basilisk-Dev 2026-04-02 16:43:54 -04:00 • committed by EAZYBLACK
commit b0d43e27e9
4 changed files with 121 additions and 11 deletions

View file

@ -124,6 +124,7 @@ var validGradientAndElementValues = [
"linear-gradient(.414rad, red, blue)",
"linear-gradient(90deg in srgb, yellow, purple)",
"linear-gradient(90deg in hsl, yellow, purple)",
"linear-gradient(90deg in lch, yellow, purple)",
"linear-gradient(90deg in oklch, yellow, purple)",
"linear-gradient(in oklab, yellow, purple)",
@ -4302,7 +4303,8 @@ var gCSSProperties = {
"hsl(0rad, 0%, 0%)",
"hsl(0turn, 0%, 0%)",
"hsl(1turn, 0%, 0%)",
/* oklab() and oklch(). */
/* lch(), oklab(), and oklch(). */
"lch(0 0 0)",
"oklab(0 0 0)",
"oklch(0 0 0)",
],
@ -4327,6 +4329,7 @@ var gCSSProperties = {
"hsl(0.5grad 400% 500% / 9.0)",
"hsl(33rad 100% 90% / 4)",
"hsl(0.33turn, 40%, 40%, 10%)",
"lch(70% 50 180deg / 40%)",
"oklab(100% 0 0)",
"oklab(60% 0.1 -0.1 / 75%)",
"oklch(70% 0.2 180deg / 40%)",
@ -4361,6 +4364,8 @@ var gCSSProperties = {
"rgb(0, 0, 0 /)",
"hsl(0 0% 0% /)",
"hsl(0, 0%, 0% /)",
"lch(0, 0 0)",
"lch(0 0 / 1)",
"oklab(0, 0 0)",
"oklab(0 0 / 1)",
"oklch(0, 0 0)",

View file

@ -399,6 +399,11 @@ var noframe_container = document.getElementById("content");
["hsla(0deg 0% 0% / 0.5)", "rgba(0, 0, 0, 0.5)"],
["hsl(0 0% 0% / 1)", "rgb(0, 0, 0)"],
["hsl(0 0% 0% / 0.5)", "rgba(0, 0, 0, 0.5)"],
["lch(0 0 0 / 1)", "rgb(0, 0, 0)"],
["lch(100% 0 0 / 0.5)", "rgba(255, 255, 255, 0.5)"],
["lch(52.2345% 72.2 56.2 / 1)", "rgb(198, 93, 6)"],
["lch(29.69% 45.553% 327.1 / 1)", "rgb(129, 0, 129)"],
["lch(150% 50 60 / 1)", "rgb(255, 255, 255)"],
["oklab(0 0 0 / 1)", "rgb(0, 0, 0)"],
["oklab(0 0 0 / 0.5)", "rgba(0, 0, 0, 0.5)"],
["oklab(150% 0.5 0.2 / 1)", "rgb(255, 0, 0)"],