r2755 - Effects core: Tweaked color animation.

r2755 - Effects core: Tweaked color animation.


Author: scott.gonzalez
Date: Sun Jun 14 19:15:56 2009
New Revision: 2755
Modified:
trunk/ui/effects.core.js
Log:
Effects core: Tweaked color animation.
Modified: trunk/ui/effects.core.js
==============================================================================
--- trunk/ui/effects.core.js    (original)
+++ trunk/ui/effects.core.js    Sun Jun 14 19:15:56 2009
@@ -241,18 +241,17 @@
// override the animation for color styles
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',
    'borderRightColor', 'borderTopColor', 'color', 'outlineColor'],
-    function(i,attr){
+function(i, attr) {
    $.fx.step[attr] = function(fx) {
-        if (fx.state == 0) {
-            fx.start = getColor( fx.elem, attr );
-            fx.end = getRGB( fx.end );
+        if (fx.state === 0) {
+            fx.start = getColor(fx.elem, attr);
+            fx.end = getRGB(fx.end);
        }
-        fx.elem.style[attr] = "rgb(" + [
-            Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) +
fx.start[0],10), 255), 0),
-            Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) +
fx.start[1],10), 255), 0),
-            Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) +
fx.start[2],10), 255), 0)
-        ].join(",") + ")";
+        fx.elem.style[attr] = 'rgb(' +
+            Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) +
fx.start[0], 10), 255), 0) + ',' +
+            Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) +
fx.start[1], 10), 255), 0) + ',' +
+            Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) +
fx.start[2], 10), 255), 0) + ')';
    };
});