R/color.id.R

Defines functions color.id

Documented in color.id

color.id<-function(col) {
 c2 <- col2rgb(col)
 coltab <- col2rgb(colors())
 cdist <- apply(coltab, 2, function(z) sum((z - c2)^2))
 colors()[which(cdist == min(cdist))]
}
plotrix/plotrix documentation built on Jan. 23, 2020, 1:38 p.m.