[cairo] Problem in using cairo_set_source_rgb
Carl Worth
cworth at cworth.org
Mon Feb 5 21:09:41 PST 2007
On Mon, 5 Feb 2007 23:03:39 -0600, "ken carlino" wrote:
> But nothing shows up. Here is my code:
> // does not work (nothing shows) when I use lime green
> cairo_set_source_rgb(cr2, 50.0, 205.0, 50.0);
Oops. Cairo is expecting values in the range of 0.0 to 1.0. So try
dividing each of those values by 255.0 and see if it doesn't work
better for you.
> // works when i set the color to red
> // cairo_set_source_rgb(cr2, 1.0, 0.0, 0.0);
Here you're using the range properly, (note that the web page you
listed shows red as (255, 0, 0).
-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070205/dcb43039/attachment.pgp
More information about the cairo
mailing list