| Title: | Notre Dame Color Palettes for R |
|---|---|
| Description: | Provides color palettes that approximate the University of Notre Dame brand colors, together with 'ggplot2' discrete color and fill scales. The default palette leads with six Notre Dame brand colors that read clearly on a white background and extends through seven former Notre Dame brand colors, interpolating when more colors are needed than the brand supplies. The palette is intended for statistical visualization and psychometric analysis: the white-safe ordering keeps plotted categories legible, and the near-white-to-navy ramps suit continuous quantities such as correlations and factor loadings. A colorblind-friendly ordering of the Notre Dame colors themselves (arranged so the colors stay distinguishable under simulated deuteranopia, protanopia, and tritanopia), the former colors as a standalone palette, the four near-white brand tints (plus six informal soft backgrounds) for backgrounds and sequential ramps, a reference table of every color with brand and role labels, and a palette-preview helper are also provided. A matching R Markdown stylesheet, built from the same colors so a report and its figures share one brand palette, themes HTML and 'shiny' output. The colors approximate those described in the University's branding guidelines (<https://onmessage.nd.edu/university-branding/colors/>). This is an independent project and is not affiliated with or endorsed by the University of Notre Dame. |
| Authors: | Ken Kelley [aut, cre] (ORCID: <https://orcid.org/0000-0002-4756-8360>) |
| Maintainer: | Ken Kelley <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0 |
| Built: | 2026-06-20 23:09:38 UTC |
| Source: | https://github.com/yelleknek/ndpalette |
An R Markdown output format that renders an HTML document styled with
the Notre Dame stylesheet (nd_css). It is a thin wrapper
around html_document: every argument of that
function is accepted and forwarded, with the Notre Dame stylesheet added
ahead of any css you supply, so a document themed this way picks
up the same brand colors its ggplot2 figures use through
scale_color_nd.
html_nd_document(css = NULL, ...)html_nd_document(css = NULL, ...)
css |
Optional additional stylesheet path(s). The Notre Dame stylesheet is always applied first; anything supplied here is layered on top, so it can override individual rules. |
... |
Further arguments passed to
|
Use it from a YAML header,
output: NDPalette::html_nd_document
or with options,
output:
NDPalette::html_nd_document:
toc: true
Requires the rmarkdown package.
An R Markdown output format object, for use in a document's
output field.
Ken Kelley [email protected]
nd_css and nd_css_path for the
stylesheet itself, and html_document for the
underlying format and its arguments.
# Returns an rmarkdown output_format object (requires the rmarkdown # package); use it in a document's YAML 'output' field. if (requireNamespace("rmarkdown", quietly = TRUE)) { fmt <- html_nd_document(toc = TRUE) class(fmt) }# Returns an rmarkdown output_format object (requires the rmarkdown # package); use it in a document's YAML 'output' field. if (requireNamespace("rmarkdown", quietly = TRUE)) { fmt <- html_nd_document(toc = TRUE) class(fmt) }
Returns the hexadecimal values of Notre Dame colors selected either by
name (one or more keys or display names from nd_colors) or
by filtering on role and brand. It is the convenient way
to grab a specific brand color, or a whole role group, without going
through a palette name.
nd_color(..., role = NULL, brand = NULL)nd_color(..., role = NULL, brand = NULL)
... |
One or more color keys or display names (character), matched
case-insensitively against the |
role |
Optional character vector of roles to keep: any of
|
brand |
Optional character vector of brands to keep:
|
Colors are returned in the order they appear in nd_colors
(for explicit names, in the order requested). The result is an unnamed
character vector, so it drops straight into
scale_color_manual, base col = arguments,
and anywhere else a color vector is expected. Metallic Dome Gold has no
sanctioned digital hex (it is a Pantone metallic ink) and is omitted
from the result; naming it explicitly produces a warning so the omission
is not silent.
An unnamed character vector of hexadecimal color strings.
Ken Kelley [email protected]
nd_colors for the full table and
nd_palette for the curated data palette.
nd_color("navy") nd_color("navy", "green") nd_color("ND Blue") # display names work too # A role group: the seven former Notre Dame colors. nd_color(role = "former") # The Athletics colors that have a digital value. nd_color(brand = "athletics")nd_color("navy") nd_color("navy", "green") nd_color("ND Blue") # display names work too # A role group: the seven former Notre Dame colors. nd_color(role = "former") # The Athletics colors that have a digital value. nd_color(brand = "athletics")
A reference table of the Notre Dame colors that NDPalette
approximates, each labeled with the brand system it belongs to
(University or Athletics) and its role within that system. Where
nd_palette is a curated, white-safe data palette,
nd_colors is the full catalog: it lists every color the package
knows about, including the near-white tints, the informal soft
backgrounds, and the Athletics colors, so a color can be found by name
and its role understood at a glance.
nd_colorsnd_colors
A data frame with one row per color and the columns:
Display name, for example "ND Blue".
Short snake_case key for nd_color, for
example "navy". Unique across the table.
Hexadecimal color string, or NA for a color
specified only as a Pantone ink (Metallic Dome Gold).
"university", "athletics", or "none"
(the informal backgrounds).
Role within the brand system: "primary",
"secondary", "former", "tint",
"informal", or "neutral".
TRUE if the color reads as a data color on a
white background, FALSE for the near-white tints, the
informal backgrounds, and white, NA when there is no hex to
assess.
Pantone reference where the brand guidance documents one,
otherwise NA.
A short plain-language note on the color: its tier
and its hue. The seven "former" rows give each color's former
Notre Dame tier (six were secondary colors and Purple the lone
tertiary color) and the hue, which a hex value or a key like
"maroon" does not give the tier of.
The role column takes the values "primary",
"secondary", "former", "tint", "informal",
and "neutral". The "informal" rows (the soft yellows of
nd_informal_tints) are not Notre Dame brand
colors; they have brand = "none" and are catalogued only as
convenient non-white backgrounds. The five Athletics rows are reference
only and are not wired into nd_palette() or the
scale_*_nd() scales.
The seven "former" colors (teal, maroon, purple, two olives, a
pale yellow, and a near-black) are former Notre Dame colors no longer in
the current brand guide. In the former brand taxonomy six were
secondary colors and Purple was the lone tertiary color.
They are kept to widen the categorical palette past the six leading
brand colors; the description column gives each one's tier and hue. The hex values approximate the University's published brand
colors and are not an official color specification. nd_colors is provided so
users can look colors up by role and brand; for plotting, reach for
nd_palette and the scale_*_nd() scales, which return
only white-safe colors in a curated order.
nd_color to pull hex values out of this table by
name or by role, nd_palette for the data palette, and
nd_tints for the near-white brand tints.
nd_colors # The former Notre Dame colors, by role. nd_colors[nd_colors$role == "former", c("name", "hex")] # The Athletics colors. nd_colors[nd_colors$brand == "athletics", c("name", "hex", "pms")]nd_colors # The former Notre Dame colors, by role. nd_colors[nd_colors$role == "former", c("name", "hex")] # The Athletics colors. nd_colors[nd_colors$brand == "athletics", c("name", "hex", "pms")]
Builds a CSS stylesheet that themes an R Markdown HTML document in the
Notre Dame colors: navy headings, a Bright Gold accent rule under the
title and first-level headings, navy table headers, and brand-tinted
callout boxes (.note, .important, .tip). The colors
are read from nd_colors, so the stylesheet always agrees
with the package palette and the scale_*_nd() plotting scales: a
figure and the prose around it carry the same brand colors.
The package also ships the generated stylesheet so it can be used
without writing a file; see nd_css_path and
html_nd_document.
nd_css(path = NULL, web_fonts = FALSE)nd_css(path = NULL, web_fonts = FALSE)
path |
Optional file path. When supplied, the stylesheet is
written there (UTF-8) and the path is returned invisibly. When
|
web_fonts |
Logical. When |
The stylesheet uses only white-safe brand colors for text and accents
(ND Blue #0c2340, Bright Gold #d39f10, Metallic Gold
#ae9142, Green #0a843d) and reserves the near-white brand
tints (nd_tints) for backgrounds and callout fills, the
same division of labor the data palette follows. Because every color is
looked up from nd_colors at build time, editing a brand
hex in the palette updates the stylesheet too; the two cannot drift
apart.
A single character string of CSS when path is
NULL; otherwise path, invisibly.
The stylesheet drops into a Shiny UI the usual ways: include the shipped
file with shiny::includeCSS(nd_css_path()), or inline the
generated CSS with
shiny::tags$head(shiny::tags$style(shiny::HTML(nd_css()))). In a
bslib app, color the Bootstrap theme from the same palette, for
example bslib::bs_theme(primary = nd_color("navy"), secondary =
nd_color("bright_gold")), so the page chrome, the prose, and the
scale_*_nd() figures all carry one set of brand colors.
Ken Kelley [email protected]
nd_css_path for the path to the stylesheet that
ships with the package, html_nd_document for an R
Markdown output format that applies it, and nd_colors
for the colors it draws on.
# The stylesheet as a string (here, just its first lines). writeLines(head(strsplit(nd_css(), "\n")[[1]], 12)) # Write it next to a report and point the YAML 'css' field at it. f <- tempfile(fileext = ".css") nd_css(f) file.exists(f)# The stylesheet as a string (here, just its first lines). writeLines(head(strsplit(nd_css(), "\n")[[1]], 12)) # Write it next to a report and point the YAML 'css' field at it. f <- tempfile(fileext = ".css") nd_css(f) file.exists(f)
Returns the path to the Notre Dame R Markdown stylesheet installed with
the package. It is the convenient way to apply the theme from a YAML
header without generating or storing a CSS file yourself: point the
css field at it.
nd_css_path()nd_css_path()
The installed file is the output of nd_css, so its colors
are the package's brand colors. In an R Markdown document, reference it
from the YAML header,
output:
html_document:
css: !expr NDPalette::nd_css_path()
or, more simply, use the html_nd_document output format,
which wires the stylesheet in for you.
A single character string: the path to nd.css inside the
installed package.
Ken Kelley [email protected]
nd_css to generate the stylesheet (for example to
write a copy you can edit) and html_nd_document for the
output format that applies it.
nd_css_path() file.exists(nd_css_path())nd_css_path() file.exists(nd_css_path())
Six warm tints for use as page or app backgrounds where a white screen
is not wanted, for example HTML reports, vignettes, and Shiny apps.
These are not University of Notre Dame brand
colors; they are informal companions to the official Warm Whites in
nd_tints. Use them only as backgrounds, never as data
colors, and do not present them as Notre Dame colors.
nd_informal_tintsnd_informal_tints
A named character vector of six hexadecimal color strings, from
the lightest tint to the warmest soft yellow. The two faint_*
tints sit just off pure white (CIE L* about 99) for the lightest touch:
faint_white (#fdfcfa), soft_white (#faf7f1),
faint_yellow (#fefdf3), soft_yellow_light
(#fdf9e6), soft_yellow (#faf3d7), and
soft_yellow_warm (#f6edc6).
nd_tints for the official near-white brand
tints, and nd_css for the R Markdown stylesheet whose
page background can be set to one of these.
nd_informal_tints # A soft-yellow page background behind a Notre Dame plot. nd_informal_tints[["soft_yellow"]]nd_informal_tints # A soft-yellow page background behind a Notre Dame plot. nd_informal_tints[["soft_yellow"]]
Returns n colors from a named qualitative palette, and supplies
the matching ggplot2 discrete color and fill scales. The default
palette, "nd", approximates the University of Notre Dame brand
colors. All functions are exported so the same colors are available in
any ggplot2 or base graphics call.
nd_palette(n = NULL, palette = "nd", reverse = FALSE) scale_color_nd(palette = "nd", reverse = FALSE, ...) scale_fill_nd(palette = "nd", reverse = FALSE, ...) scale_colour_nd(palette = "nd", reverse = FALSE, ...)nd_palette(n = NULL, palette = "nd", reverse = FALSE) scale_color_nd(palette = "nd", reverse = FALSE, ...) scale_fill_nd(palette = "nd", reverse = FALSE, ...) scale_colour_nd(palette = "nd", reverse = FALSE, ...)
n |
Number of colors to return. A single positive integer. When
|
palette |
Character string naming the palette. One of
|
reverse |
Logical. If |
... |
For the |
The Notre Dame palette. The "nd" colors approximate
the University of Notre Dame brand palette and are ordered as a
qualitative data palette. The first six are leading brand colors:
ND Blue (navy, #0c2340), Bright Gold (#d39f10), Green
(#0a843d), Bright Blue (#1c4f8f), Dark Sky Blue
(#c1cddd), and Metallic Gold (#ae9142). Of these, ND Blue
and Metallic Gold are the University's two current primaries and the
other four are secondary brand colors; nd_colors carries
the brand and role labels for the full set. Metallic Gold is placed
sixth, after Dark Sky Blue, so the two golds are not paired until a plot
has six or more groups. Because six
categories are often too few, the palette then extends through seven
former Notre Dame brand colors (teal, maroon, purple, light olive,
dark olive, pale yellow, and a near-black): historical brand colors,
no longer in the current brand guide, kept to widen the set of
distinguishable categories. They are also available on their own as
palette = "former". Their inclusion widens the categorical
palette and is not a statement about current branding; a color such
as purple appearing here should not be read as a current, primary, or
signature Notre Dame color. Brand colors that read poorly as data
colors on a white background are deliberately excluded and can never
be returned: the warm whites and the lighter sky-blue tints (exported
separately as nd_tints). Among the sky blues only the
darkest is admissible.
The colorblind-friendly palette. The "nd_cvd" palette
is the actual Notre Dame colors (current and former) reordered for
people with color vision deficiency, rather than a palette borrowed
from elsewhere. The order was derived by a greedy search that, at each
step, adds the Notre Dame color keeping the worst-case minimum CIE-Lab
Delta-E as large as possible across normal vision and simulated
deuteranopia, protanopia, and tritanopia. The ten anchors hold a
worst-case Delta-E of about 13 across all four conditions, so two
through ten categories stay distinguishable for the common forms of
color vision deficiency. It leads with ND Blue and Bright Gold, the
Notre Dame pair furthest apart under simulation. Beyond ten colors the
palette interpolates, and interpolated colors are not guaranteed to be
colorblind-safe.
Ordering and interpolation. The colors are ordered so that a
palette of a few categories uses well-separated hues, with new hues
(teal, maroon, purple) introduced early as the count grows. A
request for n colors returns the first n anchors; when
n exceeds the available anchors the set is interpolated with
colorRampPalette. The "nd_cvd" and
"former" palettes draw from their own anchors (ten and seven)
and interpolate likewise.
ggplot2 scales. scale_color_nd() and
scale_fill_nd() apply a Notre Dame palette to the colour
and fill aesthetics of a ggplot2 plot; both default to the
"nd" palette and take a palette argument so the
colorblind-friendly or former palettes can be used the same way (for
example scale_color_nd(palette = "nd_cvd")).
scale_colour_nd() is a British-spelling alias of
scale_color_nd().
For nd_palette, a character vector of n
hexadecimal color strings. For the scale_*_nd functions, a
ggplot2 scale object to add to a plot.
Ken Kelley [email protected]
nd_colors for the full color table with brand
and role labels and nd_color to pull colors from it by
name, nd_palettes for the raw anchors,
nd_tints for the near-white brand tints, and
show_palette to preview a palette.
# Two groups: Notre Dame navy and bright gold. nd_palette(2) # The six leading Notre Dame brand colors. nd_palette(6) # Seven or more colors continue into the former Notre Dame colors. nd_palette(8) # The colorblind-friendly Notre Dame ordering. nd_palette(5, palette = "nd_cvd") # The seven former Notre Dame colors on their own. nd_palette(palette = "former") # As a ggplot2 scale. set.seed(113) df <- data.frame(x = rnorm(60), y = rnorm(60), g = factor(rep(c("A", "B", "C"), each = 20))) library(ggplot2) ggplot(df, aes(x, y, color = g)) + geom_point(size = 2) + scale_color_nd()# Two groups: Notre Dame navy and bright gold. nd_palette(2) # The six leading Notre Dame brand colors. nd_palette(6) # Seven or more colors continue into the former Notre Dame colors. nd_palette(8) # The colorblind-friendly Notre Dame ordering. nd_palette(5, palette = "nd_cvd") # The seven former Notre Dame colors on their own. nd_palette(palette = "former") # As a ggplot2 scale. set.seed(113) df <- data.frame(x = rnorm(60), y = rnorm(60), g = factor(rep(c("A", "B", "C"), each = 20))) library(ggplot2) ggplot(df, aes(x, y, color = g)) + geom_point(size = 2) + scale_color_nd()
The fixed anchor palettes that back nd_palette: the
thirteen-color Notre Dame data palette (nd), the ten-color
colorblind-friendly Notre Dame ordering (nd_cvd), and the seven
former Notre Dame brand colors (former). This object is exported
so other tools (for example paletteer) and users who want the raw
hexadecimal anchors have a stable object to read.
nd_palettesnd_palettes
A named list of three character vectors of hexadecimal color
strings, of lengths 13 (nd), 10 (nd_cvd), and 7
(former).
The former entry holds historical Notre Dame brand colors that
are no longer in the current brand guide. They make up colors seven
through thirteen of the nd palette and are also selectable on
their own with nd_palette(palette = "former"). The nd_cvd
entry is a colorblind-friendly reordering of the actual Notre Dame
colors (see nd_palette).
nd_palette for the palette engine,
nd_colors for the full color table with role labels,
and nd_tints for the near-white brand tints.
nd_palettes$nd nd_palettes$nd_cvd nd_palettes$formernd_palettes$nd nd_palettes$nd_cvd nd_palettes$former
The four Notre Dame brand tints that are too light to read as data
colors on a white background and so are never returned by
nd_palette: Warm White (#efe9d9), Light Warm White
(#f8f4ec), Medium Sky Blue (#e1e8f2), and Light Sky Blue
(#edf2f9). They remain useful brand colors away from the data
layer: as panel or page backgrounds, as fills behind text, and as the
light end of a sequential brand ramp running from a pale tint to a dark
brand color.
nd_tintsnd_tints
A named character vector of four hexadecimal color strings. The
names (warm_white, light_warm_white,
medium_sky_blue, light_sky_blue) let a tint be selected
by role.
nd_informal_tints for six informal (non-brand)
soft backgrounds, nd_palette for the data
palette, nd_colors for the full color table with role
labels, and nd_palettes for the raw anchors.
nd_tints # A light background tint behind a Notre Dame plot. nd_tints[["light_sky_blue"]] # A sequential brand ramp from a light tint to a dark brand color. grDevices::colorRampPalette(c(nd_tints[["light_sky_blue"]], nd_palette(1)))(5)nd_tints # A light background tint behind a Notre Dame plot. nd_tints[["light_sky_blue"]] # A sequential brand ramp from a light tint to a dark brand color. grDevices::colorRampPalette(c(nd_tints[["light_sky_blue"]], nd_palette(1)))(5)
Draws a row of color swatches so a palette can be inspected at a
glance. By default it shows the full thirteen-color Notre Dame palette,
but it accepts any vector of colors, so it doubles as a quick preview
for nd_palette output or any hand-built palette.
show_palette(x = nd_palette(), labels = TRUE, border = "white")show_palette(x = nd_palette(), labels = TRUE, border = "white")
x |
A character vector of colors (hexadecimal strings or R color
names). Defaults to the canonical Notre Dame anchor set,
|
labels |
Controls the text drawn on each swatch. |
border |
Color of the swatch borders, passed to
|
The input vector x, invisibly. Called for the side
effect of drawing to the active graphics device.
Ken Kelley [email protected]
# The full Notre Dame palette. show_palette() # A six-color request, without labels. show_palette(nd_palette(6), labels = FALSE) # Label the swatches with readable names instead of hex values. six <- nd_palette(6) show_palette(six, labels = nd_colors$name[match(six, nd_colors$hex)]) # Any palette, not just the default: the colorblind-friendly ordering. show_palette(nd_palette(5, palette = "nd_cvd"))# The full Notre Dame palette. show_palette() # A six-color request, without labels. show_palette(nd_palette(6), labels = FALSE) # Label the swatches with readable names instead of hex values. six <- nd_palette(6) show_palette(six, labels = nd_colors$name[match(six, nd_colors$hex)]) # Any palette, not just the default: the colorblind-friendly ordering. show_palette(nd_palette(5, palette = "nd_cvd"))