lares_pal {lares} | R Documentation |
Personal Colours Palette
Description
Fetch customizable palettes for the library's usage. The package has
its own default colour-blind friendly colours but can be customized using
R internal options (i.e. options("lares.palette" = c("#FF8303" = "#000",
"#40A4D8" = "#FFF", ...))
. There are 3 options you can use to customize all
colour palletes: "lares.palette" (vector, will be used in the same order as passed,
and must have a counter colour defined), "lares.colours" (vector, simple colour
names and their HEX codes), and "lares.colours.custom" (data.frame, containing
"values" to use dynamically, "fill" for main colour, and "colour" (not obligatory)
for counter colour).
Usage
lares_pal(return = "list")
Arguments
return |
Character. Get only what you need. Select any of: "all" or "list" (list), "colors" or "colours" (vector), "pal" or "palette" (named vector), "simple" (named vector), "custom" or "personal" (data.frame) |
Value
Depending on the return
input, we get a:
-
vector
withpalette
results vector -
vector
withpalette
results vector's names -
list
withpalette
results vector,labels
results data.frame, andsimple
results named vector
See Also
Other Themes:
gg_fill_customs()
,
plot_palette()
,
theme_lares()
Examples
# Simple colour-named palette
lares_pal("simple")
# Raw colours and counter-colours
# OR simply: lares_pal("palette")
nice_palette <- lares_pal("colours")
nice_palette_ctr <- as.vector(lares_pal()$palette)
lapply(list(nice_palette, nice_palette_ctr), head)
# Personal colours by name
df <- lares_pal("custom")
df[sample(nrow(df), 5), ]