Code

color value overwrite bug fixed
authoramphi <amphi@users.sourceforge.net>
Sun, 2 Dec 2007 03:27:17 +0000 (03:27 +0000)
committeramphi <amphi@users.sourceforge.net>
Sun, 2 Dec 2007 03:27:17 +0000 (03:27 +0000)
share/extensions/color_custom.py

index b3daced3075bd2d5b6818458db5c989a1db17b8c..8d66a16680d9fcc52e3fcfaa4dbd4febac7f9e32 100644 (file)
@@ -16,16 +16,10 @@ class C(coloreffect.ColorEffect):
     r=float(_r)/255\r
     g=float(_g)/255\r
     b=float(_b)/255\r
-    #coloreffect.debug('I: %f %f %f' % (r,g,b))\r
-    r=eval(self.options.rFunction)\r
-    g=eval(self.options.gFunction)\r
-    b=eval(self.options.bFunction)\r
-    #coloreffect.debug('E: %f %f %f' % (r,g,b))\r
-    r=self.normalize(r)\r
-    g=self.normalize(g)\r
-    b=self.normalize(b)\r
-    #coloreffect.debug('N: %f %f %f' % (r,g,b))\r
-    return '%02x%02x%02x' % (int(round(r*255)),int(round(g*255)),int(round(b*255)))\r
+    r2=self.normalize(eval(self.options.rFunction))\r
+    g2=self.normalize(eval(self.options.gFunction))\r
+    b2=self.normalize(eval(self.options.bFunction))\r
+    return '%02x%02x%02x' % (int(round(r2*255)),int(round(g2*255)),int(round(b2*255)))\r
 \r
 c = C()\r
 c.affect()
\ No newline at end of file