palettes: Various Color Palettes

View source: R/S04_Plotting.R

palettesR Documentation

Various Color Palettes

Description

Returns a vector of hex color values for a specified color palette.

Usage

palettes(index = NULL, type = "colorblind", plot = FALSE)

Arguments

index

An optional vector of integers or color names to extract a subset of colors from the specified palette.

type

The color palette to return. Options include...

  • 'Colorblind' (a colorblind-friendly palette);

  • 'Grayscale' (4-bit grayscale palette).

plot

Logical; if TRUE, generates a plot showcasing the specified color palette.

Value

A character vector of hex color values for the specified palette.

Examples

# List of possible inputs to argument
# 'type' for each palette
palettes()

# Plot of colors in each palette
palettes("Colorblind", plot = TRUE)
palettes("Grayscale", plot = TRUE)

# Example of taking subset of colors
palettes("Colorblind", 1:2)

rettopnivek/arfpam documentation built on Oct. 20, 2024, 7:24 p.m.