ImageColors is a class to extract color statistics out of an image. it supports
as source :
- Grabbing a static frame out of any Item
- A QImage or a QIcon (for instance coming from a QAbstractItemModel
- An icon name from the theme
By a pixel-by pixel analisys it uses a K-means clustering algorythm
https://en.wikipedia.org/wiki/K-means_clustering
that groups averages of colors group that have a computed "distance" less than an
arbitrary value and so extracts a palette of the "dominant" colors of the image,
having also other imformations such as the % occurrence of each cluster, a
complementary color for each cluster, the global average color, the most
"vibrant" color of the image, usable as an accent, and good colors for text and
background, based on the extracted palette