From e6ab02c0cb6ba268ed0c78623aa339458e63d375 Mon Sep 17 00:00:00 2001 From: Lloyd Kupchanko Date: Sat, 3 Feb 2024 14:36:08 -0700 Subject: [PATCH] Fix incorrect parsing of Jzazbz percentage values --- src/spaces/jzazbz.js | 4 +++- tests/parse.html | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/spaces/jzazbz.js b/src/spaces/jzazbz.js index 512fc5f18..dcb908fa9 100644 --- a/src/spaces/jzazbz.js +++ b/src/spaces/jzazbz.js @@ -111,6 +111,8 @@ export default new ColorSpace({ formats: { // https://drafts.csswg.org/css-color-hdr/#Jzazbz - "color": {} + "color": { + coords: [" | ", " | [-1,1]", " | [-1,1]"], + } } }); diff --git a/tests/parse.html b/tests/parse.html index 608635f4b..b1c213fc4 100644 --- a/tests/parse.html +++ b/tests/parse.html @@ -283,6 +283,10 @@

color()

color(xyz-d50 0 100% 50%) {"spaceId":"xyz-d50","coords":[0,1,0.5],"alpha":1} + + color(jzazbz 0 25% -50%) + {"spaceId":"jzazbz","coords":[0,0.125,-0.25],"alpha":1} + color(display-p3 0 1 0 / .5) {"spaceId":"p3","coords":[0,1,0],"alpha":0.5}