Author: roidelapluie Date: 2007-06-17 14:09:45 +0200 (Sun, 17 Jun 2007) New Revision: 8292
Modified: trunk/src/gtkgui_helpers.py Log: Use another function to get color string. Fix #2906.
Modified: trunk/src/gtkgui_helpers.py =================================================================== --- trunk/src/gtkgui_helpers.py 2007-06-17 10:39:19 UTC (rev 8291) +++ trunk/src/gtkgui_helpers.py 2007-06-17 12:09:45 UTC (rev 8292) @@ -584,9 +584,8 @@ def make_color_string(color): '''create #aabbcc color string from gtk color''' col = '#' - for i in (color.red, color.green, color.blue): - # GTK sometime return a value > 256 - h = hex(i%256)[2:4] + for i in ('red', 'green', 'blue'): + h = hex(getattr(color, i) / (16*16)).split('x')[1] if len(h) == 1: h = '0' + h col += h