Added fadeto color function

This commit is contained in:
bennyschudel
2011-03-30 02:58:09 -07:00
parent 717d367364
commit 9528420561

View File

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