2013-10-31, 03:27
(2013-10-30, 22:52)hasselhof Wrote: 'Auto' button to the theme colour dialog. Seems to work ok (More time required for testing)It will not be useful for all logos. Logos with a large transparent background will probably give black or white.
Others without a clear background color will give something of an approximation/average background color.
It uses some formula based on a histogram of the image. I found it on the internet when searching for a way to generate fanart backgrounds for my Geek & Sundry plugin.
Code:
h = img.histogram()
rgb = tuple([b.index(max(b)) for b in [ h[i*256:(i+1)*256] for i in range(3) ]])