Hello,
When applying a gradient fill with alpha on its colours, I noticed some unattractive artefacts, like heavy banding effects, that are not present or less if you use solid colours with no alpha.
I wonder if it’s a bug or not, because in my use case the last band created by the gradient from the magnitude response on the bottom seems to be darker than the bottom background, which seems weird since the gradient is bright at the top, and fully transparent at the bottom.
Afaik CoreGraphics does dither gradients! And in SR’s branch I’ve also added a very basic gradient dither for the OpenGL backend because I noticed that our gradients became ugly when using it. YMMV but it worked nicely for our UIs.
Yes I confirme about CoreGraphics, when my collegue sent me a screenshot on his mac it was day and night. I ended up with opaque colours in my gradient for now, where the dither is still present but far more acceptable than when the gradient is made of transparent colours.
@Yairadix, thanks a lot for sharing your code, I’ll definitivly take a look if I move on openGL one time.
>>> background = 5
>>> color = [round(x*0.3) for x in range(10)]
>>> alpha = [0.1*round(x*0.2) for x in range(10)]
>>> [background+(c-background)*a for (c, a) in zip(color, alpha)]
[5.0, 5.0, 5.0, 4.6, 4.6, 4.7, 4.7, 4.7, 4.4, 4.6]