get_cols: Set and View Color Palettes

View source: R/get_cols.R

get_colsR Documentation

Set and View Color Palettes

Description

Retrieves color palettes from the IOBR package with options for randomization and visualization. Users can specify predefined palettes or provide custom colors.

Usage

get_cols(cols = "normal", palette = 1, show_col = TRUE, seed = 123)

Arguments

cols

Character vector of colors, or one of: - '"normal"': Use standard palette - '"random"': Randomly shuffle the palette Default is '"normal"'.

palette

Numeric or character specifying the palette. Options are 1, 2, 3, 4, or palette name. Default is 1.

show_col

Logical indicating whether to display the color palette. Default is 'TRUE'.

seed

Integer seed for random number generator when 'cols = "random"'. Default is 123.

Value

Character vector of colors.

Examples

# Get default palette
mycols <- get_cols()

# Get random palette
mycols <- get_cols(cols = "random", seed = 456)

# Use custom colors
mycols <- get_cols(cols = c("red", "blue", "green"))

IOBR documentation built on May 30, 2026, 5:07 p.m.