Changeset 8292

Show
Ignore:
Timestamp:
06/17/07 14:09:45 (18 months ago)
Author:
roidelapluie
Message:

Use another function to get color string. Fix #2906.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gtkgui_helpers.py

    r8094 r8292  
    585585        '''create #aabbcc color string from gtk color''' 
    586586        col = '#' 
    587         for i in (color.red, color.green, color.blue): 
    588                 # GTK sometime return a value > 256 
    589                 h = hex(i%256)[2:4] 
     587        for i in ('red', 'green', 'blue'): 
     588                h = hex(getattr(color, i) / (16*16)).split('x')[1] 
    590589                if len(h) == 1: 
    591590                        h = '0' + h