[cairo] Question about draw colors on transparent gtk window

Kalle Vahlman kalle.vahlman at gmail.com
Thu Aug 9 02:01:04 PDT 2007

2007/8/9, Magicloud Magiclouds <magicloud.magiclouds at gmail.com>:
> Kalle Vahlman wrote:
> > 2007/8/9, Magicloud Magiclouds <magicloud.magiclouds at gmail.com>:
> >> Dear all,
> >>     I want to draw 8 lines of cpu usage on a transparent window on
> >> desktop with 8 colors.
> >>     The attachment is my c code. In line 27, I choose the color of the
> >> line with variable "i". If I fix the rgb values, like "1, 0, 0", then it
> >> draws lines in red. While I use dynamic colors, it only draws in white.
> >>     Why does this happen? Thanks.
> >
> > Whitout the attachement it's hard to tell ;) but the symptoms sound
> > like the color values set are not within the expected 0.0...1.0 range
> > (but instead go over 1.0 and thus mean "full" for each component
> > resulting in white).
> >
> Oh, I am really sorry. Here is it.
> I have printed the rgb values out, and they were between 0 and 1.

Ah yes, you need to stroke() the lines separately if you plan on
changing the source (color) in between. So moving cairo_stroke() to
eachSic() should help here.

Kalle Vahlman, zuh at iki.fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi

More information about the cairo mailing list