R/utils.R

Defines functions tint shade

shade <- function(x, steps, crop) {
  shade <- rev(grDevices::colorRampPalette(c(x, "black"))(steps + 1))
  if (crop == 0) {
    return(rev(shade))
  }
  rev(shade[-(seq_len(crop))])
}

tint <- function(x, steps, crop) {
  tint <- rev(grDevices::colorRampPalette(c(x, "white"))(steps + 1))
  if (crop == 0) {
    return(tint)
  }
  tint[-(seq_len(crop))]
}
poissonconsulting/tinter documentation built on Aug. 14, 2020, 4:16 p.m.