Use another function to get color string. Fix #2906.
This commit is contained in:
parent
adbe675125
commit
a5e155792b
1 changed files with 2 additions and 3 deletions
|
@ -584,9 +584,8 @@ def make_python_month_gtk_month(month):
|
||||||
def make_color_string(color):
|
def make_color_string(color):
|
||||||
'''create #aabbcc color string from gtk color'''
|
'''create #aabbcc color string from gtk color'''
|
||||||
col = '#'
|
col = '#'
|
||||||
for i in (color.red, color.green, color.blue):
|
for i in ('red', 'green', 'blue'):
|
||||||
# GTK sometime return a value > 256
|
h = hex(getattr(color, i) / (16*16)).split('x')[1]
|
||||||
h = hex(i%256)[2:4]
|
|
||||||
if len(h) == 1:
|
if len(h) == 1:
|
||||||
h = '0' + h
|
h = '0' + h
|
||||||
col += h
|
col += h
|
||||||
|
|
Loading…
Add table
Reference in a new issue