-
Take a look at the screenshot below. See these lines/non-smooth transitions between the shades? I understand this is more of a general issue with gradients but is there a way to avoid banding issue on a gradient with 2 dark colour stops very close to each other? I've tried the following:
Is there a way to improve this? Is it possible to extend the colour space skia uses? Or maybe write a custom shader? Repro here |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's hard to make a smooth gradient between these two very close shades of gray as the total number of gray shades we have is 256 shades if you go from |
Beta Was this translation helpful? Give feedback.
-
Thank you for the explanation, that makes total sense. |
Beta Was this translation helpful? Give feedback.
It's hard to make a smooth gradient between these two very close shades of gray as the total number of gray shades we have is 256 shades if you go from
#000
to#FFF
when colors are represented in 24-bit true color bitmap format which is the most common in image formats. In the example you have, we only have 18 possible shades of gray to use in the gradient between the colors#000
and#111
(think of it as the hexadecimal numbers between0x00
and0x11
(17 in decimal) and this number is very small compared to the height of the screen making the gradient look that way.