| Title: | Color Palettes from the Album Covers of Each Taylor Swift Era |
|---|---|
| Description: | Provides discrete and continuous color palettes derived from the album cover artwork of each Taylor Swift Era. Each palette ships with a curated order-of-use so that smaller discrete subsets remain harmonious, and supports continuous interpolation via 'grDevices::colorRampPalette()' for arbitrary 'n'. Designed to plug into 'ggplot2' workflows through standard manual and gradient scales. |
| Authors: | Mathias Sablé-Meyer [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-0844-0775>), Sandra Reinert [aut] (ORCID: <https://orcid.org/0000-0003-4302-7433>) |
| Maintainer: | Mathias Sablé-Meyer <[email protected]> |
| License: | CC0 |
| Version: | 0.2.0 |
| Built: | 2026-05-29 12:53:26 UTC |
| Source: | https://github.com/cran/EraBrewer |
Returns a vector of colors drawn from one of the palettes in
EraPalettes. Supports both discrete (curated subsets) and
continuous (interpolated) palettes.
era.brewer( palette_name, n, type = c("discrete", "continuous"), direction = c(1, -1), override_order = FALSE, return_hex = FALSE )era.brewer( palette_name, n, type = c("discrete", "continuous"), direction = c(1, -1), override_order = FALSE, return_hex = FALSE )
palette_name |
Character. Name of the palette; must be one of
|
n |
Integer. Number of colors to return. Defaults to the full palette length. |
type |
One of |
direction |
|
override_order |
Logical. If |
return_hex |
Logical. If |
An object of class "palette": a character vector of hex
codes with the palette name stored as an attribute.
# Discrete palette using the curated order-of-use print(era.brewer("Lover2", n = 3)) # Continuous interpolation when n exceeds the stored palette length print(era.brewer("Showgirl2", n = 50, type = "continuous")) # Reverse direction print(era.brewer("Fearless", direction = -1)) # Plug into a ggplot2 manual scale library(ggplot2) ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + geom_point() + scale_color_manual(values = era.brewer("Lover2", n = 3))# Discrete palette using the curated order-of-use print(era.brewer("Lover2", n = 3)) # Continuous interpolation when n exceeds the stored palette length print(era.brewer("Showgirl2", n = 50, type = "continuous")) # Reverse direction print(era.brewer("Fearless", direction = -1)) # Plug into a ggplot2 manual scale library(ggplot2) ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + geom_point() + scale_color_manual(values = era.brewer("Lover2", n = 3))
A named list of color palettes inspired by Taylor Swift's eras. Each entry is a list of length two: a character vector of hex codes, and an integer vector giving the preferred order in which the colors should be drawn for discrete palettes of increasing size.
EraPalettesEraPalettes
A named list with one entry per palette.
A named list; each element is itself a list of length two: a character vector of hex codes and an integer vector giving the curated order-of-use for discrete subsets.
names(EraPalettes) EraPalettes[["Lover2"]]names(EraPalettes) EraPalettes[["Lover2"]]
S3 method for objects of class "palette". Renders the palette as a
row of colored tiles labeled with the palette name.
## S3 method for class 'palette' print(x, ...)## S3 method for class 'palette' print(x, ...)
x |
A |
... |
Unused. |
A ggplot object: a row of colored tiles labeled with the
palette name. Rendered when auto-printed at the top level or when
further composed with ggplot2 layers.
print(era.brewer("Lover2"))print(era.brewer("Lover2"))