Skip to content

Commit

Permalink
Fix incorrect parsing of Jzazbz percentage values
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydk committed Feb 3, 2024
1 parent 3d4cc15 commit e6ab02c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/spaces/jzazbz.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export default new ColorSpace({

formats: {
// https://drafts.csswg.org/css-color-hdr/#Jzazbz
"color": {}
"color": {
coords: ["<number> | <percentage>", "<number> | <percentage>[-1,1]", "<number> | <percentage>[-1,1]"],
}
}
});
4 changes: 4 additions & 0 deletions tests/parse.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ <h1>color()</h1>
<td>color(xyz-d50 0 100% 50%)</td>
<td>{"spaceId":"xyz-d50","coords":[0,1,0.5],"alpha":1}</td>
</tr>
<tr>
<td>color(jzazbz 0 25% -50%)</td>
<td>{"spaceId":"jzazbz","coords":[0,0.125,-0.25],"alpha":1}</td>
</tr>
<tr title="With transparency">
<td>color(display-p3 0 1 0 / .5)</td>
<td>{"spaceId":"p3","coords":[0,1,0],"alpha":0.5}</td>
Expand Down

0 comments on commit e6ab02c

Please sign in to comment.