fix the make_color_string function. Fix #1268

This commit is contained in:
Yann Leboulanger 2006-02-05 17:12:36 +00:00
parent b5c94b71c6
commit 2e50c301c8
1 changed files with 7 additions and 2 deletions

View File

@ -467,8 +467,13 @@ def make_python_month_gtk_month(month):
def make_color_string(color):
'''create #aabbcc color string from gtk color'''
return '#' + hex(color.red)[-2:] + hex(color.green)[-2:] + \
hex(color.blue)[-2:]
col = '#'
for i in (color.red, color.green, color.blue):
h = hex(i)[2:4]
if len(h) == 1:
h = '0' + h
col += h
return col
def make_pixbuf_grayscale(pixbuf):
pixbuf2 = pixbuf.copy()