[GRASS-SVN] r30154 - grass/branches/releasebranch_6_3/gui/tcltk/gis.m

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 14 11:14:13 EST 2008


Author: neteler
Date: 2008-02-14 11:14:13 -0500 (Thu, 14 Feb 2008)
New Revision: 30154

Modified:
   grass/branches/releasebranch_6_3/gui/tcltk/gis.m/gmlib.tcl
Log:
Traps a bwidget idiosyncrasy in which clicking on an undefined custom color square in the bottom row of the color chooser returns the string 'white' instead of the hex color #FFFFFF (merge from HEAD)

Modified: grass/branches/releasebranch_6_3/gui/tcltk/gis.m/gmlib.tcl
===================================================================
--- grass/branches/releasebranch_6_3/gui/tcltk/gis.m/gmlib.tcl	2008-02-14 16:07:04 UTC (rev 30153)
+++ grass/branches/releasebranch_6_3/gui/tcltk/gis.m/gmlib.tcl	2008-02-14 16:14:13 UTC (rev 30154)
@@ -28,14 +28,20 @@
 #read_moncap
 
 proc GmLib::color { color } {
-
-    regexp -- {#(..)(..)(..)} $color x r g b
-
-    set r [expr 0x$r ]
-    set g [expr 0x$g ]
-    set b [expr 0x$b ]
-
-    return "$r:$g:$b"
+        
+        if {$color == "white"} {
+                set r 255
+                set g 255
+                set b 255
+        } else {
+                regexp -- {#(..)(..)(..)} $color x r g b
+                        
+                set r [expr 0x$r ]
+                set g [expr 0x$g ]
+                set b [expr 0x$b ]
+        }
+        
+        return "$r:$g:$b"
 }
 
 



More information about the grass-commit mailing list