gtk_rgba_parse retunr wrong color

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

gtk_rgba_parse retunr wrong color

Rúben Rodrigues
Hi,

Someone knows why gdk_rgba_parse returns worng color?

I have this gdk_rgba_parse(&front_color,"rgb(8,178,23)");
   cairo_set_source_rgba(cr, front_color.red, front_color.blue,
front_color.green, front_color.alpha);

The color should be green but returns blue...

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk_rgba_parse retunr wrong color

Eric Williams
Hello,

On 06/23/2017 10:54 AM, Rúben Rodrigues wrote:

> Hi,
>
> Someone knows why gdk_rgba_parse returns worng color?
>
> I have this gdk_rgba_parse(&front_color,"rgb(8,178,23)");
>     cairo_set_source_rgba(cr, front_color.red, front_color.blue,
> front_color.green, front_color.alpha);
>
> The color should be green but returns blue...
>
> Thanks

The order of the parameters to cairo_set_source_rgba() are wrong. It
should be: cr, red, green, blue, alpha.

See:
https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-source-rgba


--
Eric Williams
Associate Software Engineer - Eclipse Team
Red Hat
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Loading...