| Type: | Package |
| Title: | Minimalist Theme and Vignette Kit for 'pkgdown' and R Markdown |
| Version: | 2.0.0 |
| Description: | Provides a minimalist 'ggplot2' theme, colour scales, and 'pkgdown' template built around a curated colour palette system inspired by Josef Albers' colour theory (Albers (1963, ISBN:978-0-300-17935-4) "Interaction of Color"). Includes helpers to apply consistent theming to 'ggplot2' plots, 'gt' tables, and 'bslib' Bootstrap 5 sites, along with one-command setup functions for adopting the style across an R package. |
| URL: | https://github.com/bbuchsbaum/albersdown, https://bbuchsbaum.github.io/albersdown/ |
| BugReports: | https://github.com/bbuchsbaum/albersdown/issues |
| Depends: | R (≥ 4.1) |
| Imports: | grDevices, grid, stats, ggplot2 |
| Suggests: | gt, bslib, usethis, yaml, cli, testthat, viridisLite, knitr, rmarkdown, pkgdown, systemfonts, ragg |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| VignetteBuilder: | knitr |
| Config/Needs/website: | albersdown |
| License: | MIT + file LICENSE |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-07-04 16:43:38 UTC; bbuchsbaum |
| Author: | Bradley R. Buchsbaum [aut, cre] |
| Maintainer: | Bradley R. Buchsbaum <brad.buchsbaum@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-05 12:20:08 UTC |
Display font for a direction, falling back to "sans" when not registered.
Description
Display font for a direction, falling back to "sans" when not registered.
Usage
.albers_direction_font(preset)
Is a font family available to R graphics (registered or system-installed)?
Description
Is a font family available to R graphics (registered or system-installed)?
Usage
.albers_font_available(family)
Color values for named Albers presets
Description
Each preset captures ground, surface, ink, and accent-role colours inspired by Bauhaus, Le Corbusier, and Josef Albers.
Usage
.preset_colors(preset = "homage")
Arguments
preset |
One of the two 2.0 directions |
Details
- homage
Cool gallery white, the Bauhaus exhibition wall.
- study
Pure analytical white from Interaction of Color plates.
- structural
Cool concrete (béton brut), shadowless precision.
- adobe
Warm architectural grey, Le Corbusier béton.
- midnight
Deep indigo-black for dark-theme contexts.
Value
Named list with bg, fg, surface, muted, grid, border, code_bg.
bs_theme for pkgdown (light/dark aware)
Description
Convenience wrapper exposing core variables; most consumers won't need this
directly if they use template: { package: albersdown }.
Usage
albers_bs_theme(
family = "red",
preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"),
accent = NULL,
bg = NULL,
fg = NULL
)
Arguments
family |
Palette family name (default |
preset |
Visual preset (default |
accent |
Primary accent color (default A700 of the chosen family). |
bg |
Background color (default derived from preset). |
fg |
Foreground/text color (default derived from preset). |
Value
A bslib::bs_theme object.
Examples
if (requireNamespace("bslib", quietly = TRUE)) {
albers_bs_theme()
}
Return a complementary family for diverging palettes
Description
Pairs warm/cool and related families to produce balanced diverging combinations that align with the Homage system.
Usage
albers_complement(
family = c("red", "lapis", "ochre", "teal", "green", "violet")
)
Arguments
family |
One of "red","lapis","ochre","teal","green","violet" |
Build 5-stop diverging spec from image-derived families
Description
Build 5-stop diverging spec from image-derived families
Usage
albers_diverging_img(low_family, high_family, neutral = "#E4E0D9")
Arguments
low_family |
Family for the low side (left) |
high_family |
Family for the high side (right) |
neutral |
Hex color for the midpoint (default derived from image) |
Value
list(colours, values)
Build a 5-stop diverging spec from two families
Description
Build a 5-stop diverging spec from two families
Usage
albers_diverging_spec(
low_family = "red",
high_family = albers_complement(low_family),
neutral = "#e5e7eb"
)
Arguments
low_family |
family driving the low side |
high_family |
family driving the high side |
neutral |
hex color at the midpoint (defaults to CSS border tone) |
Value
list(colours, values)
Return four-tone Homage family by name
Description
Return four-tone Homage family by name
Usage
albers_palette(family = c("red", "lapis", "ochre", "teal", "green", "violet"))
Arguments
family |
One of "red", "lapis", "ochre", "teal". |
Value
Named character vector of four hex colors (A900, A700, A500, A300).
Examples
albers_palette("red")
albers_palette("lapis")
Image-derived Homage palettes (A900 -> A300)
Description
Four-tone families distilled from the uploaded grid; order is darkest to lightest (A900, A700, A500, A300).
Usage
albers_palette_img(family = c("red", "lapis", "ochre", "teal", "green"))
Arguments
family |
One of "red","lapis","ochre","teal","green" |
Value
Named character vector of four hex colors (A900, A700, A500, A300).
Examples
albers_palette_img("red")
List available Albers directions
Description
Returns the two 2.0 directions: "homage" (warm cream ground, serif
body, light code) and "interaction" (cool grey ground, grotesk, dark
code). The legacy presets "study", "structural",
"adobe", and "midnight" are still accepted by
theme_albers() for backward compatibility but are no longer
featured.
Usage
albers_presets()
Value
Character vector of direction names.
Examples
albers_presets()
Interpolate n colors along a palette family gradient
Description
Uses colorRampPalette to interpolate between the
four tones of a family (A900 → A300), producing an arbitrary
number of evenly spaced colors.
Usage
albers_ramp(family = "red", n = 9, reverse = FALSE)
Arguments
family |
Palette family name. |
n |
Number of colors to return. |
reverse |
If |
Value
Character vector of n hex colors.
Examples
albers_ramp("lapis", n = 5)
Register the bundled Albers display fonts for R graphics
Description
albersdown ships static TTF builds of Familjen Grotesk (the Homage display
face) and Space Grotesk (the Interaction display face) so that ggplot2 plots
can use the same typefaces as the rendered HTML pages. Call this once per
session – for example in a vignette setup chunk – before theme_albers().
Once the fonts are registered, theme_albers() picks the direction's display
font automatically (Homage -> Familjen Grotesk, Interaction -> Space Grotesk).
Usage
albers_register_fonts()
Details
Requires the systemfonts package and a font-aware graphics device such
as ragg (e.g. knitr::opts_chunk$set(dev = "ragg_png")). Without those,
plots fall back to the system "sans" family, so package examples and CRAN
checks never depend on the bundled fonts.
Value
Invisibly, a character vector of the font families that were registered (empty if systemfonts is unavailable or the files are missing).
Examples
# Registers the bundled display fonts for the current session. Plot with a
# font-aware device (e.g. ragg); the default pdf/postscript device cannot
# render registered fonts. Wrapped in \dontrun because it mutates the
# session-wide font registry.
## Not run:
albers_register_fonts()
## End(Not run)
Visual swatch of Albers palette families and presets
Description
Draws a tile plot showing the four tones of each palette family, optionally faceted by preset ground colors. Useful for quickly previewing the design system in a notebook or presentation.
Usage
albers_swatch(
families = c("red", "lapis", "ochre", "teal", "green", "violet"),
show_presets = FALSE
)
Arguments
families |
Character vector of families to show. Defaults to all six. |
show_presets |
If |
Value
A ggplot object.
Examples
if (requireNamespace("ggplot2", quietly = TRUE)) {
albers_swatch()
}
Quiet, legible gt style with subtle stripe from A300
Description
Quiet, legible gt style with subtle stripe from A300
Usage
gt_albers(
x,
family = "red",
preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"),
base_size = 14,
width = 720,
bg = NULL,
fg = NULL
)
Arguments
x |
A |
family |
Palette family for subtle accents |
preset |
Visual preset (default |
base_size |
Base font size in pixels (default 14). |
width |
Table width in pixels (default 720). Use |
bg |
Override background color (default derived from preset). |
fg |
Override text color (default derived from preset). |
Value
A styled gt table object.
Examples
if (requireNamespace("gt", quietly = TRUE)) {
tbl <- gt::gt(head(mtcars))
gt_albers(tbl)
}
One-command migration to latest albersdown
Description
Convenience helper for existing packages that already use albersdown and need to replace older vignette/site wiring with the latest defaults while choosing an Albers accent family and preset.
Usage
migrate_albersdown(
path,
family = "red",
preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"),
dry_run = FALSE
)
Arguments
path |
Path to the package directory. Must be supplied explicitly; there is no default so that the function never writes to an unexpected location. |
family |
one of: "red","lapis","ochre","teal","green","violet" |
preset |
Visual preset (default |
dry_run |
if TRUE, report changes without writing files. |
Value
TRUE invisibly.
Examples
if (interactive()) {
migrate_albersdown(path = ".", family = "teal", preset = "midnight", dry_run = TRUE)
}
Scales that use the family's tones (discrete/continuous)
Description
Scales that use the family's tones (discrete/continuous)
Usage
scale_color_albers(family = "red", discrete = TRUE, ...)
scale_fill_albers(family = "red", discrete = TRUE, ...)
Arguments
family |
Palette family. |
discrete |
Whether to use a discrete palette; if FALSE, uses a gradient. |
... |
Passed to underlying |
Value
A ggplot2 scale object.
Examples
if (requireNamespace("ggplot2", quietly = TRUE)) {
ggplot2::ggplot(iris, ggplot2::aes(Sepal.Length, Sepal.Width,
color = Species)) + ggplot2::geom_point() + scale_color_albers()
}
Distinct, colorblind-friendly line palette across families
Description
Uses one high-contrast tone (default A700) from different families to maximize separation between lines. This departs from the single-family aesthetic but improves readability for multi-series lines.
Usage
scale_color_albers_distinct(n = NULL, tone = c("A700", "A900", "A500"), ...)
Arguments
n |
Number of colors needed; defaults to length of available families (6). |
tone |
One of "A700", "A900", or "A500". |
... |
Passed to |
Value
A ggplot2 scale object.
Examples
if (requireNamespace("ggplot2", quietly = TRUE)) {
df <- data.frame(x = 1:6, y = 1:6, g = paste0("G", 1:6))
ggplot2::ggplot(df, ggplot2::aes(x, y, color = g)) +
ggplot2::geom_point() + scale_color_albers_distinct()
}
Diverging color scale (continuous)
Description
Diverging color scale (continuous)
Usage
scale_color_albers_diverging(
low_family = "red",
high_family = albers_complement(low_family),
midpoint = 0,
neutral = "#e5e7eb",
...
)
Arguments
low_family, high_family |
Homage families for the two sides |
midpoint |
numeric midpoint for the diverging scale (default 0) |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
Value
A ggplot2 scale object.
Diverging color scale with multiple stops (continuous)
Description
Uses a 5-stop palette (low2, low1, neutral, high1, high2) for smoother transitions around the midpoint.
Usage
scale_color_albers_diverging_n(
low_family = "red",
high_family = albers_complement(low_family),
neutral = "#e5e7eb",
...
)
Arguments
low_family, high_family |
Homage families for the two sides |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
Value
A ggplot2 scale object.
Convenience scale: highlight vs other (color)
Description
Returns a manual color scale mapping a single highlighted group to a family tone (default A700) and all other points to a neutral gray.
Usage
scale_color_albers_highlight(
family = "red",
tone = c("A700", "A900", "A500", "A300"),
other = "#9aa0a6",
highlight = "highlight",
other_name = "other",
...
)
Arguments
family |
Palette family name. |
tone |
One of A900, A700, A500, A300 used for the highlight color. |
other |
Hex color used for non-highlight values. |
highlight |
Name of the value that should receive the highlight color. |
other_name |
Name of the value that should receive the neutral color. |
... |
Passed to |
Value
A ggplot2 scale object.
Image-derived sequential color scale
Description
Image-derived sequential color scale
Usage
scale_color_albers_img(family = "red", discrete = TRUE, ...)
scale_fill_albers_img(family = "red", discrete = TRUE, ...)
Arguments
family |
One of "red","lapis","ochre","teal","green" |
discrete |
Whether to use discrete palette; if FALSE uses a gradient. |
... |
Passed to underlying ggplot2 scale. |
Value
A ggplot2 scale object.
Image-derived diverging color scale (gradientn)
Description
Image-derived diverging color scale (gradientn)
Usage
scale_color_albers_img_diverging(
low_family,
high_family,
neutral = "#E4E0D9",
...
)
Arguments
low_family |
Family for the low side (left) |
high_family |
Family for the high side (right) |
neutral |
Hex color for the midpoint (default derived from image) |
... |
Passed to ggplot2::scale_color_gradientn |
Value
A ggplot2 scale object.
Pre-canned image-derived diverging pairs
Description
Pre-canned image-derived diverging pairs
Usage
scale_color_albers_img_red_teal(neutral = "#E4E0D9", ...)
scale_color_albers_img_lapis_ochre(neutral = "#E4E0D9", ...)
scale_color_albers_img_green_red(neutral = "#E4E0D9", ...)
scale_fill_albers_img_red_teal(neutral = "#E4E0D9", ...)
scale_fill_albers_img_lapis_ochre(neutral = "#E4E0D9", ...)
scale_fill_albers_img_green_red(neutral = "#E4E0D9", ...)
Arguments
neutral |
Midpoint color (default from image); use "#e5e7eb" to match site CSS |
... |
Passed to the underlying gradientn scale |
Value
A ggplot2 scale object.
Distinct, colorblind-friendly fill palette across families
Description
Uses one high-contrast tone (default A700) from different families
to maximize separation between filled regions. Fill counterpart of
scale_color_albers_distinct.
Usage
scale_fill_albers_distinct(n = NULL, tone = c("A700", "A900", "A500"), ...)
Arguments
n |
Number of colors needed; defaults to length of available families (6). |
tone |
One of "A700", "A900", or "A500". |
... |
Passed to |
Value
A ggplot2 scale object.
Diverging fill scale (continuous)
Description
Diverging fill scale (continuous)
Usage
scale_fill_albers_diverging(
low_family = "red",
high_family = albers_complement(low_family),
midpoint = 0,
neutral = "#e5e7eb",
...
)
Arguments
low_family, high_family |
Homage families for the two sides |
midpoint |
numeric midpoint for the diverging scale (default 0) |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
Value
A ggplot2 scale object.
5-class diverging (discrete)
Description
Useful for binned choropleths or sliced residuals. The middle class uses the neutral color.
Usage
scale_fill_albers_diverging_5(
low_family = "red",
high_family = albers_complement(low_family),
neutral = "#e5e7eb",
labels = ggplot2::waiver(),
...
)
scale_color_albers_diverging_5(
low_family = "red",
high_family = albers_complement(low_family),
neutral = "#e5e7eb",
labels = ggplot2::waiver(),
...
)
Arguments
low_family, high_family |
Homage families for the two sides |
neutral |
hex color for the midpoint (default matches CSS border) |
labels |
Optional labels for the five classes (low2, low1, mid, high1, high2) |
... |
Passed to |
Value
A ggplot2 scale object.
Diverging fill scale with multiple stops (continuous)
Description
Diverging fill scale with multiple stops (continuous)
Usage
scale_fill_albers_diverging_n(
low_family = "red",
high_family = albers_complement(low_family),
neutral = "#e5e7eb",
...
)
Arguments
low_family, high_family |
Homage families for the two sides |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
Value
A ggplot2 scale object.
Convenience scale: highlight vs other (fill)
Description
Convenience scale: highlight vs other (fill)
Usage
scale_fill_albers_highlight(
family = "red",
tone = c("A700", "A900", "A500", "A300"),
other = "#9aa0a6",
highlight = "highlight",
other_name = "other",
...
)
Arguments
family |
Palette family name. |
tone |
One of A900, A700, A500, A300 used for the highlight color. |
other |
Hex color used for non-highlight values. |
highlight |
Name of the value that should receive the highlight color. |
other_name |
Name of the value that should receive the neutral color. |
... |
Passed to |
Value
A ggplot2 scale object.
Image-derived diverging fill scale (gradientn)
Description
Image-derived diverging fill scale (gradientn)
Usage
scale_fill_albers_img_diverging(
low_family,
high_family,
neutral = "#E4E0D9",
...
)
Arguments
low_family |
Family for the low side (left) |
high_family |
Family for the high side (right) |
neutral |
Hex color for the midpoint (default derived from image) |
... |
Passed to ggplot2::scale_fill_gradientn |
Value
A ggplot2 scale object.
Discrete linetype scale to pair with Albers colors
Description
Provides a sensible set of linetypes for multi-series line charts.
Usage
scale_linetype_albers(...)
Arguments
... |
Passed to |
Value
A ggplot2 scale object.
Minimal, legible plot theme inspired by Josef Albers
Description
Minimal, legible plot theme inspired by Josef Albers
Usage
theme_albers(
family = "red",
preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"),
base_size = 13,
base_family = NULL,
bg = NULL,
fg = NULL,
grid_color = NULL
)
Arguments
family |
Palette family used by companion scales. |
preset |
Visual direction: |
base_size |
Base font size. |
base_family |
Base font family. Plots fall back to the system "sans"
stack; install the matching typefaces (Familjen Grotesk / Space Grotesk,
etc.) and pass e.g. |
bg |
Override background color (default derived from preset). |
fg |
Override foreground/text color (default derived from preset). |
grid_color |
Override grid line color (default derived from preset). |
Value
A ggplot2 theme object.
Examples
if (requireNamespace("ggplot2", quietly = TRUE)) {
ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) +
ggplot2::geom_point() + theme_albers()
}
Stripped theme for maps, brain surfaces, and abstract compositions
Description
Extends theme_albers by removing axes, grid lines, ticks,
and panel border – leaving only the plot background, titles, and legend.
Useful for spatial visualizations where coordinate axes are meaningless.
Usage
theme_albers_void(
family = "red",
preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"),
base_size = 13,
base_family = NULL,
bg = NULL,
fg = NULL
)
Arguments
family |
Palette family used by companion scales. |
preset |
Visual direction: |
base_size |
Base font size. |
base_family |
Base font family. Plots fall back to the system "sans"
stack; install the matching typefaces (Familjen Grotesk / Space Grotesk,
etc.) and pass e.g. |
bg |
Override background color (default derived from preset). |
fg |
Override foreground/text color (default derived from preset). |
Value
A ggplot2 theme object.
Configure current package to use albersdown (back-compat wrapper)
Description
This wrapper preserves the old name and forwards to use_albersdown().
Usage
use_albers_vignettes(path = ".", ...)
Arguments
path |
Path to the package directory. Defaults to the current working directory to preserve the original wrapper behavior. |
... |
Additional arguments passed to |
Value
TRUE invisibly.
Examples
if (interactive()) {
use_albers_vignettes()
}
One-shot setup for existing packages
Description
Turn-key retrofit to adopt the albersdown theme in an existing package. Copies local assets for CRAN-safe vignettes, ensures pkgdown template, optionally patches all vignettes, writes a README note, and prints a doctor report.
Usage
use_albersdown(
path,
family = "red",
preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"),
apply_to = c("all", "new"),
dry_run = FALSE,
fallback_extra = c("auto", "always", "never"),
force_replace = TRUE
)
Arguments
path |
Path to the package directory. Must be supplied explicitly; there is no default so that the function never writes to an unexpected location. |
family |
one of: "red","lapis","ochre","teal","green","violet" |
preset |
Visual preset (default |
apply_to |
"all" to patch every .Rmd/.qmd in vignettes/, or "new" to only add the template and assets |
dry_run |
if TRUE, show changes without writing |
fallback_extra |
Controls writing site-wide fallbacks into
|
force_replace |
if TRUE (default), overwrite existing albersdown assets and replace existing vignette CSS/header hooks so albersdown becomes the active theme. |
Value
TRUE invisibly.
Examples
if (interactive()) {
use_albersdown(path = ".", dry_run = TRUE)
}