[cairo] RGB channels are set to zero if alpha is 0.

Uli Schlachter psychon at znc.in
Sun Aug 27 09:31:22 UTC 2017


On 27.08.2017 02:55, Bram Stolk wrote:
> The left half of the image is set to 1,1,1,0.
> The right half of the image is set to 1,1,1,1

Uhm, why do you think so? These numbers do not appear in your example

> cr.rectangle(0, 0, 0.5, 1)
> cr.set_source_rgba(1, 1, 1, 0/255.0)
> cr.fill()

This is a no-op. You draw with alpha=0, i.e. fully transparent. Thus,
nothing happens here. The image stays the way it was before, fully

> cr.set_source_rgba(1,1,1, 1/255.0)
> cr.rectangle(0.5,0,1,1)
> cr.fill()

Why this low alpha?


More information about the cairo mailing list