rainbow: Create a vector of a rainbow of colors

View source: R/colorVectors.R

rainbowR Documentation

Create a vector of a rainbow of colors

Description

rainbow is useful for getting a set of colors for graphs when you need a LOT of colors; there are prettier and more easily distinguishable options if you only have a couple of comparisons.

Usage

rainbow(ncolors, shade = "regular")

Arguments

ncolors

number of colors desired

shade

the shade of colors to use, which can be "regular" (default), "darker", "lighter", or "muted" (although "muted" in this case is the same as "darker")

Value

a character vector of colors

Examples

# Create a rainbow of 10 colors.
rainbow(10)

# Try using scales::show_col() to visualize the colors, ex:
scales::show_col(rainbow(10))


shirewoman2/Consultancy documentation built on June 1, 2025, 6:05 p.m.