From 9528420561340b58855236f99554c44c874dfea0 Mon Sep 17 00:00:00 2001 From: bennyschudel Date: Wed, 30 Mar 2011 02:58:09 -0700 Subject: [PATCH 1/2] Added fadeto color function --- lib/less/functions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/less/functions.js b/lib/less/functions.js index 5d2d89c0..445fc36e 100644 --- a/lib/less/functions.js +++ b/lib/less/functions.js @@ -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; From 5130179dc531e0c45b117a9a4c2a79655501b09a Mon Sep 17 00:00:00 2001 From: bennyschudel Date: Wed, 30 Mar 2011 03:02:09 -0700 Subject: [PATCH 2/2] renamed fadeto to fade --- lib/less/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/less/functions.js b/lib/less/functions.js index 445fc36e..4923fbf0 100644 --- a/lib/less/functions.js +++ b/lib/less/functions.js @@ -86,7 +86,7 @@ tree.functions = { hsl.a = clamp(hsl.a); return hsla(hsl); }, - fadeto: function (color, amount) { + fade: function (color, amount) { var hsl = color.toHSL(); hsl.a = amount.value / 100;