R/color_helpers.R
nearRcolor.Rd
Find close R colors() to a given color (original by Marius Hofert) using Euclidean norm in (HSV / RGB / ...) color space
nearRcolor( rgb, cSpace = c("hsv", "rgb255", "Luv", "Lab"), dist = switch(cSpace, hsv = 0.1, rgb255 = 30, Luv = 15, Lab = 12) )
rgb | Can be character string of built-in R color name like "tomato" or color rgb as vector ex c(255,99,71) |
---|
Marius Hofert, originally