Skip to content

Commit

Permalink
Fix srgb to linear
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme authored Oct 1, 2024
1 parent 5acae8a commit 72a0534
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/value/color/space/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ double hueToRgb(double m1, double m2, double hue) {
double srgbAndDisplayP3ToLinear(double channel) {
// Algorithm from https://www.w3.org/TR/css-color-4/#color-conversion-code
var abs = channel.abs();
return abs < 0.04045
return abs <= 0.04045
? channel / 12.92
: channel.sign * math.pow((abs + 0.055) / 1.055, 2.4);
}
Expand Down

0 comments on commit 72a0534

Please sign in to comment.