Palette: Generates a color palette (a vector of colors) between two...

Description Usage Arguments Value Author(s) Examples

Description

Generates a vector of n colors that ramp between the two specified colors, evenly spaced in either RGB space (mode = "RGB") or HSV space (mode = "HSV")

Usage

1
Palette(color1, color2, n, mode = "RGB",circular = TRUE)

Arguments

color1

A color, either specified by name (e.g. "red") or hex code (e.g. "FF0000")

color2

A second color

n

The number of colors to produce

mode

Either "RGB" or "HSV", specifies whether to ramp between the colors in RGB space or HSV space.

circular

If using mode = "HSV", specifies whether to ramp between hues using circular means. This is usually a good idea because hues are essentially circular (a hue of 0.01 is very similar to 0.99), but produces results with a clear break if the span of hues covers more than half of the circle.

Value

A vector of n colors.

Author(s)

Brody Sandel

Examples

1
2
TestPalette(Palette("Green","Red",100))
TestPalette(Palette("Green","Red",100,"HSV"))

Example output



painter documentation built on May 2, 2019, 10:46 a.m.

Related to Palette in painter...