art_pals {artpack} | R Documentation |
Custom-built artpack Color Palettes
Description
The artpack palette picker. The art_pals
function consists of 18 palettes: "arctic",
"beach", "bw", "brood", "cosmos", "explorer", "gemstones", "grays", "icecream", "imagination",
"majestic", "nature", "neon", "ocean", "plants", "rainbow", "sunnyside", "super"
Usage
art_pals(pal = NULL, n = 5, direction = "regular")
Arguments
pal |
A character string of the desired artpack palette. The 18 artpack palettes include:
|
n |
The numbers of colors desired in the output. Default is |
direction |
The direction of the palette Default is "regular". Only two options accepted: "regular" or "reverse" |
Value
A Character Vector.
Examples
library(ggplot2)
dots <- data.frame(x = c(1:10), y = 2.5)
dots$fills <- art_pals("rainbow", 10)
dots |>
ggplot(aes(x, y)) +
theme_void() +
geom_point(
shape = 21,
fill = dots$fills,
color = "#000000",
size = 10,
stroke = 2
)
dots_rev <- data.frame(x = c(1:10), y = 2.5)
dots_rev$fills <- art_pals("rainbow", 10, "reverse")
dots_rev |>
ggplot(aes(x, y)) +
theme_void() +
geom_point(
shape = 21,
fill = dots_rev$fills,
color = "#000000",
size = 10,
stroke = 2
)