Possible Duplicate:
Similarity Between Colors
I know it’s not a programming question but I think the understanding of the color models is always bound to a programmer’s life.
So we were having an argument about a certain color in the office. I was saying that a particular color was more near to pink and a colleague said it was more close to purple.
The question is how can I measure the distance of a color from another color?
Example:
Pink=(255, 192, 203) –>A
Purple=(128, 0, 128) –>B
Color in question=(232,143,253)–>C
The A or B is closest to C?

A simple method is to calculate the Euclidean distance in the RGB cube using the formula:
√((r2-r1)2 + (g2-g1)2 + (b2-b1)2)
However this won’t accurately measure the human perception of closeness. For example, the human eye is more sensitive to some colours than others. To take this into account you will need to look at some research on the topic of human perception of colour. This Wikipedia page has some good starting points: Color difference