Skip to content

Commit

Permalink
Allow hwb to accept numbers (#464)
Browse files Browse the repository at this point in the history
Fixes #368
  • Loading branch information
lloydk authored Feb 29, 2024
1 parent a1a11cb commit ae9ea42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/spaces/hwb.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default new ColorSpace({

formats: {
"hwb": {
coords: ["<number> | <angle>", "<percentage>", "<percentage>"],
coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"],
},
},
});
4 changes: 4 additions & 0 deletions test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ const tests = {
args: "hwb(none 20% 30%)",
expect: '{"spaceId":"hwb","coords":[null,20,30],"alpha":1}',
},
{
args: "hwb(180 20 30)",
expect: '{"spaceId":"hwb","coords":[180,20,30],"alpha":1}',
},
],
},
],
Expand Down

0 comments on commit ae9ea42

Please sign in to comment.