palette_coolors: Coolors palette generator

Description Usage Arguments Value Examples

View source: R/palette_coolors.R

Description

Use palette_coolors to construct palettes of desired length

Usage

1
palette_coolors(palette_num, n, hex = FALSE, hist = TRUE)

Arguments

palette_num

integer; arbitrary palette identifier. Randomly generated by default, or can be specifically chosen from existing Coolors palettes using an integer between 1 and 2092.

n

integer; desired length of palette. Default length 5. Lengths greater than 5 will use color interpolation to create palette from original 5-color palette.

hex

logical; TRUE provides a character vector of hex codes.

hist

logical; indicates whether an object storing palette history is created/updated for the current session. Since this function's default color generation scheme is random, this allows the user to review recently-generated palettes via their identifiers, stored in a list. The most recent palette will be list item 1, the second-most recent list item 2, etc.

Value

A vector of colors.

Examples

1
2
3
4
5
6
7
8
# generate random palette
palette_coolors()

# random palette of length 10
palette_coolors(n = 10)

# if you liked a specific palette, specify its identifier
palette_coolors(palette_num = 1234, n = 20)

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