I have a HSV value of a color. I need to map it to the colosest color in my list of colors {red,green,blue,grey,orange,purple,yellow,black,white,gold}.
How do I do this mapping. Someone told me to just check the hue ranges. eg : red is 0-10 and 320-260 (eg), but the color also depends on S and V value and the color shade changes upon changing these values.
My question is : how do I map my hsv value to a color in my list.
Please suggest.
Thanks in advance
PS : I am writing the code in java
Edit :
Example : red hsv ranges from (0,100,100) to (12,100,100). But when I change the S and V values, red ranges from (0,50,50) to (3,50,50). Changing the HSV values changes my range.So,the color name depends on S and V. Also, 202,19,58 hsv is grey and so is 154,4,56. But the hsv for grey is 0,50,50. How do I determine gray from HSV then. My HSV function returned 202,19,59. The color becomes green,blue,grey when used different S and V values. Please tell me how can I identify my colors.
At present I am finding the closest distance approach to compare my HSV with the DB color HSV to return the color name.