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))]
}

Try the plotrix package in your browser

Any scripts or data that you put into this service are public.

plotrix documentation built on Nov. 10, 2023, 5:07 p.m.