Learn R Programming

emil (version 2.0.2)

get_color: Get color palettes

Description

Can be used to modify an existing palette, e.g. change brightness, or to generate a palette for a response vector.

Usage

get_color(x, ...)

## S3 method for class 'default': get_color(x, s, v, alpha, ...)

## S3 method for class 'factor': get_color(x, levels = FALSE, col = "Set1", ...)

Arguments

x
Character vector of colors or factor of class memberships to generate colors for.
...
s
Saturation. s = 0 leaves it unchanged, 0 < s <= 1<="" code=""> increases, and -1 <= s="" <="" 0<="" code=""> decreases.
v
Value. s = 0 leaves it unchanged, 0 < s <= 1<="" code=""> increases, and -1 <= s="" <="" 0<="" code=""> decreases.
alpha
Transparency.
levels
If TRUE a palette with one color per level of x is returned. If FALSE one color per element in x is returned.
col
Color palette with one color per class or the name of the color brewer palette to use, see name argument of brewer.pal for a list of possible values.

Value

  • A character vector of hex colors.