gghcl {miscset}R Documentation

HTML Colours Like ggplot2

Description

Calculate HTML colour code from a palette like ggplot2 uses.

Usage

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

#

# 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}

#

[Package miscset version 1.1.0 Index]