Skip to content

Commit

Permalink
Remove adjust-hue() from sass:color (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Sep 27, 2019
1 parent 75305a1 commit 7d34406
Showing 1 changed file with 9 additions and 9 deletions.
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

0 comments on commit 7d34406

Please sign in to comment.