Convert the 10 colors in RGB.
Here there is a list of common colors
link[
^].
A color can then be represended in a 3D domain where the 3 axes are R-G-B.
Plot in that domain also the point relatad to the unknown pixel...then you can recognise the right color computing the distance between this point to the other given 10.