greens: Create a vector of greens

View source: R/colorVectors.R

greensR Documentation

Create a vector of greens

Description

greens is useful for getting a set of colors from chartreuse to forest green for graphs. These are from the RColorBrewer package, color set "YlGn", just to give credit where it's due, but they can be any number in length rather than only up to 9 colors.

Usage

greens(ncolors, shade = "regular")

Arguments

ncolors

number of colors desired

shade

the shade of colors to use, which can be "regular" (default), "darker", or "lighter"

Value

a character vector of colors

Examples

# Create a set of 10 colors that are deepening shades of green.
greens(10)

# Try using scales::show_col() to visualize the colors, ex:
scales::show_col(greens(ncolors = 10))
scales::show_col(greens(ncolors = 10, shade = "darker"))


shirewoman2/Consultancy documentation built on Feb. 18, 2025, 10 p.m.