Forgive me in advance for my ignorance.
Using the PHP function imagecolorat, I have a solution that presently delivers a set of the most dominant hex color codes available inside of an image.
Is there a known library that will allow me to then take the hex color code, RGB code (or any other standard color code) and simplify them down, or rather "match" them to a limited set of "common colors", such as red, brown, green, yellow, grey, blue, etc?
For example, #944D70, which is a shade of purple, would be matched to the color 'purple'.
Is there a particular pattern or range to RGB colors that would allow me to write such a library myself?
For example, 0,0,0 thru 20,20,20 might all be considered a "black" color. However, it seems as if organizing such a library would be very exhausting if done manually.