jcolors_contin {jcolors}R Documentation

continuous palettes of colors for figures

Description

Creates different color palette functions

Usage

jcolors_contin(
  palette = c("default", "pal2", "pal3", "pal4", "pal10", "pal11", "pal12", "rainbow"),
  reverse = FALSE,
  interpolate = c("spline", "linear"),
  ...
)

Arguments

palette

Character string indicating a palette of colors.

reverse

logical value indicating whether the color palette should be reversed. Defaults to FALSE

interpolate

Character string for color interpolation method. "linear" or "spline" interpolation available

...

other arguments to be passed to colorRampPalette. See colorRampPalette for details

Value

returns a function that takes an integer argument (the required number of colors), which then returns a character vector of colors

Examples


colfunc <- jcolors_contin()
jcols   <- colfunc(1000)
n       <- length(jcols)
image(1:n, 1, as.matrix(1:n),
      col  = jcols,
      xlab = "", ylab = "",
      xaxt = "n", yaxt = "n", bty = "n")


[Package jcolors version 0.0.5 Index]