All of my methods are failing me in various ways. different lighting can mess it all up too.
has anyone every trying to return a name given a rgb value? \"red\" \"gr
I personally find it more natural to think of colors in terms of hue/saturation/brightness than RGB values, and I think that would work well for you in this case. Try this:
Assign color names to certain ranges of the spectrum, as you see fit. For example, maybe red is 0-39, orange is 40-79, etc. (those are arbitrary numbers - I have no idea if they fit on any kind of scale or not). Then calculate the hue from your RGB value (you can find a formula here, although there may be others). Once you know the hue, you know what range of the spectrum it's in, and you can give it a name.