R/col2hex.R

Defines functions col2hex

Documented in col2hex

col2hex <- function(col, alpha = FALSE) {
  rgb <- col2rgb(col, alpha)
  if (alpha) {
    apply(rgb, 2, function(z) rgb(z[1], z[2], z[3], z[4], maxColorValue=255))
  } else {
    apply(rgb, 2, function(z) rgb(z[1], z[2], z[3], maxColorValue=255))
  }
}

Try the bSims package in your browser

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

bSims documentation built on Oct. 7, 2021, 9:13 a.m.