Skip to content

Commit

Permalink
Gamut-map HSL/HWB in their native color spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Apr 18, 2024
1 parent fbbb68a commit 70cb1c9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/src/functions/color.dart
Expand Up @@ -475,12 +475,7 @@ final module = BuiltInModule("color", functions: <Callable>[
(arguments[2].assertString("method")..assertUnquoted("method")).text);
if (!space.isBounded) return color;

return color
.toSpace(space == ColorSpace.hsl || space == ColorSpace.hwb
? ColorSpace.srgb
: space)
.toGamut(method)
.toSpace(color.space);
return color.toSpace(space).toGamut(method).toSpace(color.space);
}),

_function("channel", r"$color, $channel, $space: null", (arguments) {
Expand Down

0 comments on commit 70cb1c9

Please sign in to comment.