I'm working on a space wallpaper sharing gallery. I've used the JavaScript library color-thief to retrieve the dominant colors of an image, but I have a problem. Most wallpapers are dark. If when searching for a wallpaper, a user chooses say a blue color like #07F, he will not get the many dark wallpapers that have this color, because the dominant color these wallpapers will be close to black.
I could allow the use of multiple dominant colors for searching (i.e black and blue for example), but that would make the search more complicated.
Is there any JavaScript library (must be done on client side) able to get the dominant hues of an image ? And if not, do you have any idea about how i could implement an algorithm for doing it ?
Thanks for reading :)