title: Given an RGB value what would be the best way to find the closest match in the database?
body: <p>I have a rgb value and if it doesn't exist in the color table in my database I need to find the closest color.  I was thinking of comparing all values and finding the difference(in red,green,and blue) then take the average.  The lowest average deviation should be the closest color.  There seems to me like there should be a better way.  Any ideas?</p>