[Tkabber-dev] r363 - trunk/plugins/nicksanecolors

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Jul 15 19:25:43 MSD 2010


Author: hekp0maht
Date: 2010-07-15 19:25:43 +0400 (Thu, 15 Jul 2010)
New Revision: 363

Modified:
   trunk/plugins/nicksanecolors/Changelog
   trunk/plugins/nicksanecolors/nicksanecolors.tcl
Log:
2010-07-15  Andrey Kozlov  <xmpp:hekp0maht at jabber.ru>

        * nicksanecolors.tcl v 0.1.3. Operator ** (raise to power) is not 
        supported in tcl8.4. Replaced mith multiplication.



Modified: trunk/plugins/nicksanecolors/Changelog
===================================================================
--- trunk/plugins/nicksanecolors/Changelog	2010-06-27 20:42:10 UTC (rev 362)
+++ trunk/plugins/nicksanecolors/Changelog	2010-07-15 15:25:43 UTC (rev 363)
@@ -1,3 +1,8 @@
+2010-07-15  Andrey Kozlov  <xmpp:hekp0maht at jabber.ru>
+
+	* nicksanecolors.tcl v 0.1.3. Operator ** (raise to power) is not 
+	supported in tcl8.4. Replaced mith multiplication.
+
 2010-06-15  Andrey Kozlov  <xmpp:hekp0maht at jabber.ru>
 
 	* v 0.1.2. Compare pool colors with each other too using

Modified: trunk/plugins/nicksanecolors/nicksanecolors.tcl
===================================================================
--- trunk/plugins/nicksanecolors/nicksanecolors.tcl	2010-06-27 20:42:10 UTC (rev 362)
+++ trunk/plugins/nicksanecolors/nicksanecolors.tcl	2010-07-15 15:25:43 UTC (rev 363)
@@ -1,4 +1,4 @@
-# nicksanecolors.tcl, v 0.1.2 - Copyright (C) 2010 hekp0maht <xmpp:hekp0maht at jabber.ru>
+# nicksanecolors.tcl, v 0.1.3 - Copyright (C) 2010 hekp0maht <xmpp:hekp0maht at jabber.ru>
 # Reinitialize ::plugins::nickcolors::NickColorPool for better text distinction
 # Consider background color when selecting foreground colors
 # Compare colors in pool with each other to not to add almost similar colors
@@ -152,7 +152,7 @@
 		set r1 [lindex $color_rgb 0]
 		set g1 [lindex $color_rgb 1]
 		set b1 [lindex $color_rgb 2]
-		set color_distance [expr 30*($r1-$r0)**2+59*($g1-$g0)**2+11*($b1-$b0)**2]
+		set color_distance [expr 30*($r1-$r0)*($r1-$r0)+59*($g1-$g0)*($g1-$g0)+11*($b1-$b0)*($b1-$b0)]
 		if {$color_distance >= $color_distance_threshold_min && $color_distance <= $color_distance_threshold_max} {
 			set add_this_color true
 			if {$pool_distance_threshold_min > 0} {
@@ -161,7 +161,7 @@
 					set pool_r1 [lindex $pool_color_rgb 0]
 					set pool_g1 [lindex $pool_color_rgb 1]
 					set pool_b1 [lindex $pool_color_rgb 2]
-					set pool_color_distance [expr 30*($pool_r1-$r1)**2+59*($pool_g1-$g1)**2+11*($pool_b1-$b1)**2]
+					set pool_color_distance [expr 30*($pool_r1-$r1)*($pool_r1-$r1)+59*($pool_g1-$g1)*($pool_g1-$g1)+11*($pool_b1-$b1)*($pool_b1-$b1)]
 					if {$pool_color_distance < $pool_distance_threshold_min} {
 						set add_this_color false
 						break



More information about the Tkabber-dev mailing list