Skip to contents

Color Mapping

Usage

palette_color_continuous(x, palette = NULL, domain = NULL, na = "#DDDDDD", ...)

palette_color_discrete(
  x,
  palette = NULL,
  domain = NULL,
  ordered = FALSE,
  na = "#DDDDDD",
  ...
)

Arguments

x

A vector of values.

palette

A vector of colors or a color function that values will be mapped to (see grDevices::colorRamp()).

domain

A numeric range or categorical data (according to x).

na

The color to return for NA values.

...

Currently not used.

ordered

A logical scalar: should the levels be treated as already in the correct order?

Value

A character vector of colors.

See also

Other palettes: palette_shape(), palette_size()