Implement ability to get `Texture`'s average colour
Some design elements require sampling colour from the texture. This implementation covers this functionality in the simplest way possible - getting average colour of non-transparent pixels.
However I'm marking this as a draft due to this issue https://github.com/ppy/osu/issues/9307. Basically looks like iterating over pixel data may cause performance issues.
Where is this intended to be used? Also are you sure we want average colour? Generally things like this prefer a smarter algorithm, which picks the accent colours from an image.
Where is this intended to be used?
It's used in the song-select for beatmap panels
Also are you sure we want average colour? Generally things like this prefer a smarter algorithm, which picks the accent colours from an image.
Smarter algo would be better, yes. But at first I would like to be sure that I'm putting things in the right place (and if so - probably would be better to combine with ComputeOpacity to avoid 2 loops over pixels in worst case scenario).
May be we want to expose pixel data somehow and compute the colour osu-side upon request or something?