Skip to content

Commit eb89325

Browse files
committed
fix color wrapping in spin
1 parent eda45ef commit eb89325

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

lessc.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,10 @@ function lib_spin($args) {
15561556
list($color, $delta) = $this->colorArgs($args);
15571557

15581558
$hsl = $this->toHSL($color);
1559-
$hsl[1] = $this->clamp($hsl[1] + $delta, 360);
1559+
1560+
$hsl[1] = $hsl[1] + $delta % 360;
1561+
if ($hsl[1] < 0) $hsl[1] += 360;
1562+
15601563
return $this->toRGB($hsl);
15611564
}
15621565

tests/inputs/colors.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,8 @@ body {
108108
direct: darken(#fcf4e3, 3%); // #fbefd5
109109
}
110110

111+
// spin around
112+
pre {
113+
@errorBackground: #f2dede;
114+
spin: spin(@errorBackground, -10);
115+
}

tests/outputs/colors.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ body {
6464
spin:#fcf4e3;
6565
chained:#fbeed5;
6666
direct:#fbefd5;
67-
}
67+
}
68+
pre { spin:#f2dee1; }

0 commit comments

Comments
 (0)