|
From: Steve C. <ste...@ya...> - 2004-10-25 13:07:39
|
John, I'm trying to understand the methods backend_gtk.ColorManagerGTK.get_color() backend_gtk.ColorManagerGTK.get_rgb() They convert color representations from rgb (three floats in the range 0.0 - 1.0) to gdk.Color (three integers in the range 0 - 65535) get_rgb() divides by 65535 but get_color() multiplies by 65025. So if I run >>> import gtk >>> import backend_gtk >>> cm=backend_gtk.ColorManagerGTK() >>> cm.set_drawing_area(gtk.DrawingArea()) >>> gdk_color=gtk.gdk.Color(1000,1000,1000) >>> rgb_color=cm.get_rgb(gdk_color) >>> gdk_color=cm.get_color(rgb_color) >>> print gdk_color.red, gdk_color.green, gdk_color.blue 992 992 992 The color (1000,1000,1000) has become (992,992,992). It looks to me like get_color() should multiply by 65535, or is there a special reason for using 65025? Regards, Steve |