hexName | R Documentation |
Find the closest named colour to a given six character hex colour
hexName(x, method = "rgb", metric = "euclidean")
x |
vector of six digit hex colours |
method |
colour space, either "rgb" or "hsv". |
metric |
distance metric, either "euclidean" or "manhattan". |
If metric is "euclidean", distances are root sum-of-squares
differences. "manhattan" distances are the sum of absolute differences.
The named colours come from the list of 657 named colours stored in R,
accessible using the colors()
function.
vector of nearest named colour
hexName(c("#117733", "#b58900", "#855C75"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.