Unfortunately, computing the distance between the colors using the
RGB color space is not the best way to measure the similarity between
two given colors. Indeed, RGB is not a perceptually uniform color
space. This means that two colors at a given distance might look very
similar, while two other colors separated by the same distance might
look very different.
To solve this problem, other color representations that have the property
of being perceptually uniform have been introduced. In particular, the
CIE Lab* is one such color model. By converting our images to this
representation, the Euclidean distance between an image pixel and the
target color will then be a meaningful measure of the visual similarity
between the two colors.