distanceRGB method added, see code comments