OK, I happen to be a digital photographer that also teaches about the inner structure of jpg files and the like.
You seem to have a table with rgb colors for use in websites.
What i was trying to find out, is what your definition (in words) of "closest match" is, the code follows from that.
You could go for standard deviation on the rgb series?
Edit: sorry i see now what you mean by "euclidian distance".
The RGB model is a 3D cube, and each color has 3 coordinates.
You now come with an "unknown color", which is also a point in the cube.
You want to find out what the closest "known" point is".
Is that it ?