Merge pull request #229 from bennyschudel/master

add fade() function
This commit is contained in:
Alexis Sellier
2011-08-18 03:38:21 -07:00

View File

@@ -86,6 +86,13 @@ tree.functions = {
hsl.a = clamp(hsl.a);
return hsla(hsl);
},
fade: 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;