mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
add fadein & fadeout color functions
This commit is contained in:
@@ -72,6 +72,20 @@ tree.functions = {
|
||||
hsl.l = clamp(hsl.l);
|
||||
return hsla(hsl);
|
||||
},
|
||||
fadein: function (color, amount) {
|
||||
var hsl = color.toHSL();
|
||||
|
||||
hsl.a += amount.value / 100;
|
||||
hsl.a = clamp(hsl.a);
|
||||
return hsla(hsl);
|
||||
},
|
||||
fadeout: function (color, amount) {
|
||||
var hsl = color.toHSL();
|
||||
|
||||
hsl.a -= amount.value / 100;
|
||||
hsl.a = clamp(hsl.a);
|
||||
return hsla(hsl);
|
||||
},
|
||||
spin: function (color, amount) {
|
||||
var hsl = color.toHSL();
|
||||
var hue = (hsl.h + amount.value) % 360;
|
||||
|
||||
Reference in New Issue
Block a user