Closed ncw closed 1 week ago
This is a confusion with how color.RGBA
works. Switch it to color.NRGBA
and it will work as planned.
The reason is that RGBA is "pre-multiplied" so any value of R, G or B that is greater than A is invalid. NRGBA is what you would expect from hex codes or CSS values.
Thanks for the explanation and sorry for the noise.
Checklist
Describe the bug
Canvas text with alpha transparency doesn't render correctly.
If you run the program below it should produce two texts of very nearly the same color, but it produces one black and one red.
The difference is that the red text has alpha 255 whereas the black text has alpha 254
How to reproduce
Run the example code
Screenshots
Example code
Fyne version
v2.5.3-0.20241117144446-a48acbbf88de (latest develop)
Go compiler version
go1.23.2
Operating system and version
Ubuntu 22.04.5 LTS
Additional Information
No response