(Replying to PARENT post)
Converting to LAB would give you access to the Delta E formulas.
I wrote an introduction to dE here, if you're curious: http://zschuessler.github.io/DeltaE/learn/
Check out the demo page as well, if you're on desktop: http://zschuessler.github.io/DeltaE/demos/de76-chroma-key/
The repo is public domain. Hack around with the library if you'd like!
๐คzschuessler๐10y๐ผ0๐จ๏ธ0
(Replying to PARENT post)
Hmm. I wonder if converting to HSV first would change the results.
๐คminikomi๐10y๐ผ0๐จ๏ธ0
(Replying to PARENT post)
This particular algorythm and others that I've seen don't take this into account. Depending on the image, you could also take into account the lightness and darkness to find the dominant colour however small amounts in the image.