Reputation:
I am drawing on drawing area using cairo in pygtk. I set color of line using this func:
cr.set_source_rgb(203,12,41)
but it showing white color instead of this color #CB0C33
it is like red rose color.
So please can any one tell me how to change color of line to any color using cairo in pygtk.
Please help me.
thank you in advanced...
Upvotes: 1
Views: 1836
Reputation: 20482
set_source_rgb expects you to pass floating point values from 0 to 1, where 1 should correspond to FF. Pls, check if the code below would work for you:
color = gtk.gdk.Color('#CB0C33')
cr.set_source_rgb(float(color.red) / 65535,
float(color.green) / 65535,
float(color.blue) / 65535)
hope this helps, regards
Upvotes: 3