How to implement search-by-color when all you have is a good coffee
Using the distance of the colors in a Euclidian space makes sense, but RGB isn't the best space to use.You probably want something like CIELAB which is (quoting from Wikipedia) "designed so that the same amount of numerical change... corresponds to roughly the same amount of visually perceived change."https://en.m.wikipedia.org/wiki/CIELAB_color_space