Learn R Programming

MultIS (version 0.6.2)

ggplot_colors: Get the default ggplot color palette or a color palette based on the ggplot palette, but with sub-colors that differ in their luminance

Description

This is an adapted version of https://stackoverflow.com/a/8197703

Usage

ggplot_colors(n = 6, h = c(0, 360) + 15, l = c(65, 65))

Arguments

n

The number of colors in the color palette. If `n` is a vector, get a color palette, that has `length(n)` different base colors. For each item in n, the actual colors are equally spaced on in the luminance range `l` between the upper and lower value.

h

The hue range.

l

A vector of length 2 that describes the luminance range

Value

A vector of `sum(n)` colors strings