Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for lch() tests #2108

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/functions/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ double? _channelFromValue(ColorChannel channel, SassNumber? value) =>
'Expected $value to have unit "%".', channel.name),
LinearChannel() =>
_percentageOrUnitless(value, channel.max, channel.name),
_ => value.coerceValueToUnit('deg', channel.name)
_ => value.coerceValueToUnit('deg', channel.name) % 360
});

/// Returns whether [value] is an unquoted string case-insensitively equal to
Expand Down
2 changes: 1 addition & 1 deletion lib/src/value/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class SassColor extends Value {

/// This color's hue, between `0` and `360`.
@Deprecated('Use channel() instead.')
double get hue => _legacyChannel(ColorSpace.hsl, 'hue') % 360;
double get hue => _legacyChannel(ColorSpace.hsl, 'hue');

/// This color's saturation, a percentage between `0` and `100`.
@Deprecated('Use channel() instead.')
Expand Down
2 changes: 1 addition & 1 deletion lib/src/value/color/space/lch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LchColorSpace extends ColorSpace {
const LchColorSpace()
: super('lch', const [
LinearChannel('lightness', 0, 100),
LinearChannel('chroma', 0, 100),
LinearChannel('chroma', 0, 150),
hueChannel
]);

Expand Down