Given different values of RGB triplet (ex. [255, 255, 255] or [1,2,3]), I want to map it to a fixed set of colors (Red,Blue,Green,Black,White,Yellow,Pink,Purple,Beige,Brown,Orange,Grey).
As an example, when I give "0,0,0", BLACK should be the mapped output. Simialrly, Grey for "190,190,190". Values of the map will be enumerated colors defined above (12 in number).
Maintaining a reverse mapping with fixed set of colors and calculating square difference of every new RGB triplet with all the elements of map is the one way but results are not that good with the approach. Reason of bad results could be that 12 colors we have chosen are not uniformly distributed in the color space (not sure though :)).
This data will further be used for clustering.
Is there any library (preferably Java/C++ or OpenCV) or website which does the similar task and I could leverage it?
Thanks in advance!