>>>>> "John" == John Finlay <[EMAIL PROTECTED]> writes:
John> The color allocation parameters are integer values from
John> 0-65535. White is (65535,65535,65535). Try something like
John> (0,0,65535).
John> Some more info about GCs:
John> http://www.moeraki.com/pygtktutorial/sec-drawingarea.html
Thanks, that helps a bunch. I'm just going to paste my notes on color
below for any one who google's this thread in the future
Drawing in color:
cmap = widget.get_colormap()
# you can specify a color using a hex value
#color = cmap.alloc("#FF9999")
# you can specify a color using name from /usr/X11R6/lib/X11/rgb.txt
#color = cmap.alloc("DarkSlateGray")
# you can specify a color using an R,G,B from 0-65535
#color = cmap.alloc(0,0,65535)
# DarkSlateGray is 49,79,47 on a 255,255,255 color scale.
# Multiply by 255 to scale to the units of alloc, which are
# 0-65535 for each R,G,B value
color = cmap.alloc(49*255,79*255,79*255)
fill = 1
gc = widget.get_parent_window().new_gc()
gc.foreground = color
widget.draw_arc(gc,
fill, x, y,
r1, r2,
0,360*64)
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/