I'm able to capture the RGB values of colors from a photo, but I want to be able to programmatically detect if that color is a value of Red, Orange, Yellow, Green, Blue, Purple, Tan or White or Black.
So I would need to specify RGB ranges that would return, for example, a value of red... or blue... and so on. I've got something like this currently, but it doesn't include all the possible RGB varieties.
RED
R = 255, G <= 102, B = 0
R = 255, G = 0, B <= 150
ORANGE & YELLOW
R = 255, G >= 108 & <= 252, B = 0
R = 240, G = 255, B = 0
and so on...
Does anyone know how to take ANY RGB value and detect if it's a value of Red, Orange, Yellow, Green, Blue, Purple, Tan, White or Black?
hue. Wikipedia has a decent article onhueincluding various formulae that might get you on your way. See hue - user1864610