Skip to content

Commit

Permalink
HSL, HSV, HWB should always be serialized after gamut mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaVerou committed Jun 23, 2022
1 parent 5a5077f commit 960b4ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/spaces/hsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default ColorSpace.create({
formats: {
functions: {
"hsl": {
toGamut: true,
coords: ["<number> | <angle>", "<percentage>", "<percentage>"],
},
"hsla": {
Expand Down
7 changes: 7 additions & 0 deletions src/spaces/hsv.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,12 @@ export default ColorSpace.create({
(l === 0 || l === 1)? 0 : ((v - l) / Math.min(l, 1 - l)) * 100,
l * 100
];
},
formats: {
functions: {
color: {
toGamut: true,
}
}
}
});
1 change: 1 addition & 0 deletions src/spaces/hwb.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default ColorSpace.create({
formats: {
functions: {
"hwb": {
toGamut: true,
coords: ["<number> | <angle>", "<percentage>", "<percentage>"],
}
}
Expand Down

0 comments on commit 960b4ab

Please sign in to comment.