shuffle_pal: Randomly shuffle part or all of a color palette

Description Usage Arguments Value Examples

View source: R/shuffle_pal.R

Description

Randomly shuffle part or all of a color palette

Usage

1
shuffle_pal(palette = .data, freeze, hist = TRUE)

Arguments

palette

character vector of hexadecimal color values, with each beginning with "#". Alternatively, a double vector of length 1 specifying the numeric identifier of palette_coolors palette.

freeze

double vector specifying the positions of colors to freeze (i.e. not shuffle). Must be length 1:n, where n is the length of the palette specified.

hist

boolean, default TRUE; indicates whether to write results of shuffled palette to history using coolors_history().

Value

A vector of hexadecimal color values.

Examples

1
2
3
# shuffle a known color palette, keeping colors 2:3
library(magrittr)
palette_coolors(palette_num = 123) %>% shuffle_pal(freeze = 2:3)

simmwill/coolors documentation built on Dec. 23, 2021, 2:23 a.m.