get_color: Get color palettes

Description Usage Arguments Value Author(s)

View source: R/plotting.r

Description

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

Usage

1
2
3
4
5
6
7
get_color(x, ...)

## Default S3 method:
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.

...

Sent to get_color.default.

s

Saturation. s = 0 leaves it unchanged, 0 < s <= 1 increases, and -1 <= s < 0 decreases.

v

Value. s = 0 leaves it unchanged, 0 < s <= 1 increases, and -1 <= s < 0 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.

Author(s)

Christofer Bäcklin


emil documentation built on Aug. 1, 2018, 1:03 a.m.

Related to get_color in emil...