Package 'spellbind'

Title: RLadies+ Brand Toolkit for R
Description: Colour palettes, ggplot2 themes, and colour scales for the RLadies+ visual identity. Provides a consistent branded look for data visualisations, reports, and presentations created by RLadies+ chapters worldwide.
Authors: Athanasia Mo Mowinckel [aut, cre] (ORCID: <https://orcid.org/0000-0002-5756-0223>), RLadies+ [cph] (ROR: <https://ror.org/05wpb1k41>)
Maintainer: Athanasia Mo Mowinckel <[email protected]>
License: CC BY 4.0
Version: 0.1.0
Built: 2026-05-14 21:10:44 UTC
Source: https://github.com/rladies/spellbind

Help Index


RLadies+ brand colours

Description

Access individual colours or the full palette from the RLadies+ brand.

Usage

rladies_cols(...)

Arguments

...

Character names of colours to retrieve. If empty, returns all colours as a named character vector.

Value

A named character vector of hex colour values.

Examples

rladies_cols()
rladies_cols("purple", "rose", "blue")
rladies_cols("charcoal")

RLadies+ R Markdown output formats

Description

Output format functions for creating branded RLadies+ documents. Use these in the output field of your R Markdown YAML header, or select them from RStudio's "From Template" menu.

Usage

rladies_html(toc = TRUE, toc_float = TRUE, ...)

rladies_pdf(toc = FALSE, ...)

Arguments

toc

Logical. Include a table of contents?

toc_float

Logical. Float the table of contents (HTML only)?

...

Additional arguments passed to the underlying format function.

Examples

## Not run: 
# In YAML header:
# output: spellbind::rladies_html
# output: spellbind::rladies_pdf

## End(Not run)

Tint or shade an RLadies+ brand colour

Description

Mix a brand colour with lavender (tint) or charcoal (shade), following the RLadies+ brand guidelines. This is the same approach used in the brand SCSS — all tints mix towards lavender white, all shades mix towards Bastille Black.

Usage

rladies_mix(colour, amount = 0.5, mode = c("tint", "shade"))

Arguments

colour

A colour name from the brand palette (e.g. "purple", "blue", "rose") or any hex colour string.

amount

Numeric between 0 and 1. The proportion of the original colour to keep. amount = 0.75 gives a 75% tint (mostly colour, lightly mixed with lavender/charcoal).

mode

Either "tint" (mix towards lavender) or "shade" (mix towards charcoal).

Value

A hex colour string.

Examples

rladies_mix("purple", 0.75)
rladies_mix("purple", 0.50, mode = "shade")

scales::show_col(vapply(
  c(0.25, 0.50, 0.75, 1),
  function(x) rladies_mix("blue", x),
  character(1)
))

RLadies+ colour palettes

Description

Returns a colour palette function or vector from the RLadies+ brand.

Usage

rladies_pal(palette = "main", reverse = FALSE, ...)

Arguments

palette

Name of the palette. One of "main", "full", "purple", "blue", "rose", "neutral", "diverging", or "light".

reverse

Logical. Reverse the palette order?

...

Additional arguments passed to grDevices::colorRampPalette().

Value

A function that takes an integer n and returns n interpolated colours.

Examples

rladies_pal("main")(3)
rladies_pal("purple")(6)
rladies_pal("diverging", reverse = TRUE)(7)

RLadies+ colour and fill scales for ggplot2

Description

Discrete and continuous colour/fill scales using the RLadies+ brand palettes.

Usage

scale_colour_rladies(palette = "main", reverse = FALSE, ...)

scale_color_rladies(palette = "main", reverse = FALSE, ...)

scale_fill_rladies(palette = "main", reverse = FALSE, ...)

scale_colour_rladies_c(palette = "purple", reverse = FALSE, ...)

scale_color_rladies_c(palette = "purple", reverse = FALSE, ...)

scale_fill_rladies_c(palette = "purple", reverse = FALSE, ...)

Arguments

palette

Name of the palette (see rladies_pal() for options).

reverse

Logical. Reverse the palette order?

...

Additional arguments passed to ggplot2::discrete_scale() or ggplot2::scale_colour_gradientn().

Examples

library(ggplot2)

ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) +
  geom_point(size = 3) +
  scale_colour_rladies() +
  theme_rladies()

ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
  geom_tile() +
  scale_fill_rladies_c("purple") +
  theme_rladies()

RLadies+ ggplot2 theme

Description

A clean ggplot2 theme using the RLadies+ brand palette. Supports light and dark modes with transparent backgrounds for seamless embedding in branded documents and dashboards.

Usage

theme_rladies(base_size = 13, mode = c("light", "dark"), grid = TRUE)

Arguments

base_size

Base font size in points.

mode

Either "light" (charcoal text on transparent background) or "dark" (lavender text on transparent background).

grid

Logical. Show major gridlines?

Value

A ggplot2::theme() object.

Examples

library(ggplot2)

ggplot(mtcars, aes(wt, mpg)) +
  geom_point(colour = rladies_cols("purple"), size = 3) +
  labs(title = "Weight vs Fuel Efficiency") +
  theme_rladies()

ggplot(mtcars, aes(wt, mpg)) +
  geom_point(colour = rladies_cols("purple_50"), size = 3) +
  labs(title = "Dark mode") +
  theme_rladies(mode = "dark")