R/genColorPal.R

Defines functions genColorPal

Documented in genColorPal

genColorPal <-
function(min, max, length, col=NULL)
{
  if ( missing(length) )
    length <- (max - min) * 10 + 1
  if ( missing(col) ) 
    col=c("purple", "blue", "darkblue", "cyan", "green", "darkgreen", "yellow",
          "orange", "red", "darkred")
  fpal <- colorRampPalette(colors = col)
  seqb <- seq(min, max, length.out = length)
  nbcols = length(seqb) - 1
  result <- list(pal = fpal(nbcols), breaks = seqb)
  result
}
r-forge/satin documentation built on Feb. 18, 2022, 2:39 a.m.