Closed trinker closed 7 years ago
col2hex <- function(x){ stopifnot(all(x %in% grDevices::colors())) m <- col2rgb(x, alpha = FALSE) rgb(m[1,], m[2,], m[3,], maxColorValue=255) } col2hex(c('purple', 'black', 'red'))