Learn R Programming

aRtsy (version 0.2.4)

colorPalette: Color Palette Generator

Description

This function creates a random color palette, or allows the user to select a pre-implemented palette.

Usage

colorPalette(
  name,
  n = NULL
)

Value

A vector of colors.

Arguments

name

name of the color palette. Can be random for random colors, complement for complementing colors, divergent for equally spaced colors, or random-palette for a random palette, but can also be the name of a pre-implemented palette. See the details section for a list of pre-implemented palettes.

n

the number of colors to select from the palette. Required if name = 'random', name = 'complement', or name = 'divergent'. Otherwise, if NULL, automatically selects all colors from the chosen palette.

Author

Koen Derks, koen-derks@hotmail.com

Details

The following color palettes are implemented:

colors

Examples

Run this code
colorPalette("divergent", 5)

Run the code above in your browser using DataLab