File: color.id.R

package info (click to toggle)
r-cran-plotrix 2.9-3-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 960 kB
  • sloc: makefile: 3
file content (6 lines) | stat: -rw-r--r-- 171 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
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))]
}