gghcl: HTML Colours Like ggplot2

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/gghcl.R

Description

Calculate HTML colour code from a palette like ggplot2 uses.

Usage

1
gghcl(n, sub = 1:n, h = c(0, 360) + 15, c = 100, l = 65, ...)

Arguments

n

Numeric value to determine size of palette.

sub

Numeric vector with values within range from 1 to n to subset palette.

h

Hue of the colour. Within range of a circle's degrees.

c

Chroma of the colour.

l

Luminance of the colour. Within range from 1 to 100.

...

Further arguments passed to function hcl.

Details

See ?hcl for explanation of h, c and l.

Value

Returns a character vector containing HTML colour code of the standard ggplot colour palette.

Author(s)

Sven E. Templer

See Also

hcl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#

# Plot some palettes:
par(mfrow = c(3,1), mai = c(.1,.1,1,.1))
p <- matrix(1:10, 10)
image(p, col = gghcl(5), axes = FALSE, main ="gghcl(5)")
image(p, col = gghcl(10), axes = FALSE, main = "gghcl(10)")
image(p, col = gghcl(10, 1:5), axes = FALSE, main ="gghcl(10, 1:5)")
# dev.off() # to reset \code{par}

#

setempler/miscset documentation built on May 29, 2019, 8 p.m.