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

Remove adjust-hue() from sass:color #828

Merged
merged 2 commits into from Sep 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/src/functions/color.dart
Expand Up @@ -66,7 +66,7 @@ final global = UnmodifiableListView([
}),

// ### HSL
_hue, _saturation, _lightness, _adjustHue, _complement,
_hue, _saturation, _lightness, _complement,

BuiltInCallable.overloaded("hsl", {
r"$hue, $saturation, $lightness, $alpha": (arguments) =>
Expand Down Expand Up @@ -117,6 +117,12 @@ final global = UnmodifiableListView([
return color.changeHsl(saturation: 0);
}),

BuiltInCallable("adjust-hue", r"$color, $degrees", (arguments) {
var color = arguments[0].assertColor("color");
var degrees = arguments[1].assertNumber("degrees");
return color.changeHsl(hue: color.hue + degrees.value);
}),

BuiltInCallable("lighten", r"$color, $amount", (arguments) {
var color = arguments[0].assertColor("color");
var amount = arguments[1].assertNumber("amount");
Expand Down Expand Up @@ -239,7 +245,8 @@ final module = BuiltInModule("color", functions: [
}),

// ### HSL
_hue, _saturation, _lightness, _adjustHue, _complement,
_hue, _saturation, _lightness, _complement,
_removedColorFunction("adjust-hue", "hue"),
_removedColorFunction("lighten", "lightness"),
_removedColorFunction("darken", "lightness", negative: true),
_removedColorFunction("saturate", "saturation"),
Expand Down Expand Up @@ -355,13 +362,6 @@ final _lightness = BuiltInCallable(
(arguments) =>
SassNumber(arguments.first.assertColor("color").lightness, "%"));

final _adjustHue =
BuiltInCallable("adjust-hue", r"$color, $degrees", (arguments) {
var color = arguments[0].assertColor("color");
var degrees = arguments[1].assertNumber("degrees");
return color.changeHsl(hue: color.hue + degrees.value);
});

final _complement = BuiltInCallable("complement", r"$color", (arguments) {
var color = arguments[0].assertColor("color");
return color.changeHsl(hue: color.hue + 180);
Expand Down