Returns a palette as a function(n), the form ggplot2 scales and theme
palettes expect. Asking for the number of anchor colors returns the anchors
themselves; any other n follows the palette's rule.
Details
| Palette | Colors | Other lengths |
"categorical" | plum, honey, cobalt, leaf, rust, berry, mauve, charcoal | the first n, in order; more than eight is an error |
"categorical_dark" | honey, lilac, leaf, rust, light blue, mauve | the first n; more than six is an error |
"seq_purple", "seq_neutral", "seq_gray", "seq_red", "seq_honey", "seq_green", "seq_rust", "seq_cobalt" | seven steps from warm_white to the named color | ramped |
"diverging" | charcoal, plum, warm_white, red | ramped |
"diverging_green" | plum to green, five steps | ramped |
"quiet" | muted purple to muted sage around a light gray, five steps | ramped |
"quiet_purple", "quiet_sage" | five steps, dark to light | ramped |
"likert" | rust, rust_light, sand, green_light, green | ramped; an odd n centers on sand |
Categorical palettes
The categorical palettes never ramp: unordered groups need colors that are
clearly different, so one group too many is an error, not an in-between
shade. Red is not a categorical color. It is reserved for emphasis; see
maison_highlight().
"categorical_dark" is for charcoal backgrounds, and
theme_maison(dark = TRUE) uses it. Every color has at least 3:1 contrast
against charcoal, and they run from the highest contrast to the lowest.
Four are categorical colors: honey, leaf, rust and mauve. Plum and charcoal
vanish on charcoal, and cobalt and berry fall just short, so blue and
purple come from lighter steps of maison's own ramps: #5884AC from
"seq_cobalt" and lilac #A99AAF from "quiet_purple".
Sequential ramps
Seven of the seq_* ramps are hand-tuned. "seq_cobalt" is generated to
match their step spacing.
Quiet palettes
The quiet family is for scales with no good or bad direction, such as
"prefer A" against "prefer B".
See also
scale_fill_maison_d() and friends for ready-made scales.
Examples
maison_pal("categorical")(3)
#> [1] "#463752" "#DBA940" "#246A9B"
maison_pal("likert")(7)
#> [1] "#D4663A" "#DC8463" "#E4A987" "#EBD4A6" "#A1B893" "#679173" "#3C6046"
maison_pal("seq_cobalt")(7)
#> [1] "#FAF9F7" "#EBEEF0" "#D0D9E3" "#ABBDD2" "#84A0BF" "#5884AC" "#246A9B"
maison_pal("quiet", reverse = TRUE)(5)
#> [1] "#465351" "#9AAFA9" "#DADADA" "#A99AAF" "#514653"