colorpalette: Provides colorpalettes containing R built-in colors

Description Usage Arguments Value Author(s) See Also Examples

View source: R/LSD.color.r

Description

Provides pre-designed colorpalettes (character vectors containing R built-in colors) of this and several other R packages (grDevices, RColorBrewer, colorRamps) as well as custom-made ones.

Usage

1
2
3
4
5
6
7
8
9
colorpalette(
  colpal,
  nrcol = NULL,
  simulate = FALSE,
  daltonize = FALSE,
  cvd = "p",
  alpha = NULL,
  rev = FALSE
)

Arguments

colpal

a character vector containing R built-in color names or a name of a LSD colorpalette as a character string (see disco() or disco).

nrcol

a non-negative integer specifying the number of colors to be used (defaults to length of colpal, if not specified).

simulate

logical: if TRUE (FALSE by default), a converted colorpalette is returned to simulate dichromat vision according to http://www.daltonize.org (see daltonize).

daltonize

logical: if TRUE (FALSE by default), a converted colorpalette is returned to enhance dichromat vision according to http://www.daltonize.org (see daltonize).

cvd

character string implying the type of color vision deficiency ("p" for protanope, "d" for deuteranope or "t" for tritanope).

alpha

alpha value: a two-digit integer between 01 and 99 for color opacity, i.e. appearance of partial or full transparency (usage omitted by default).

rev

logical: if TRUE (FALSE by default), a reversed colorpalette is returned.

Value

colorpalette returns a vector containing R built-in colors in hexadecimal representation.

Author(s)

Achim Tresch, Bjoern Schwalb

See Also

disco, demotour

Examples

1
2
colorpalette("heat")
colorpalette(c("darkred","grey","darkblue"),10)

Example output

[1] "#BEBEBE" "#00008B" "#FF0000" "#FFA500" "#FFD700"
 [1] "#8B0000" "#962A2A" "#A15454" "#AD7E7E" "#B8A8A8" "#A8A8B8" "#7E7EAD"
 [8] "#5454A1" "#2A2A96" "#00008B"

LSD documentation built on July 2, 2020, 4:14 a.m.

Related to colorpalette in LSD...