From a5e155792b1a599e688b8fdc4dbd32ac790ec552 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sun, 17 Jun 2007 12:09:45 +0000 Subject: [PATCH] Use another function to get color string. Fix #2906. --- src/gtkgui_helpers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index a833ee4bd..3622adc8e 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -584,9 +584,8 @@ def make_python_month_gtk_month(month): 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