The colorname(s) of the closest match(es) (if more than one).

Arguments

hexstr

a color or a vector of colors specified as hexadecimal string of the form "#RRGGBB" or "#RRGGBBAA"

method

character string specifying the color space to be used. Can be "rgb" (default) or "hsv".

metric

character string specifying the metric to be used for calculating distances between the colors.
Available options are "euclidean" (default) and "manhattan". Euclidean distances are root sum-of-squares of differences, and manhattan distances are the sum of absolute differences.

Author

Ben Bolker, vector support Andri Signorell <andri@signorell.net>

Details

Finds the color with the minimum squared distance in RGB space.