Package {NDPalette}


Type: Package
Title: Notre Dame Color Palettes for R
Version: 1.0.0
Date: 2026-06-05
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.
Imports: graphics, grDevices, utils
Suggests: ggplot2 (≥ 3.4.0), knitr, rmarkdown, shiny, bslib, colorspace, testthat (≥ 3.0.0)
VignetteBuilder: knitr
Depends: R (≥ 4.0.0)
URL: https://kenkelley.org, https://github.com/yelleKneK/NDPalette
BugReports: https://github.com/yelleKneK/NDPalette/issues
License: GPL (≥ 3)
Encoding: UTF-8
Config/testthat/edition: 3
RoxygenNote: 7.3.2
NeedsCompilation: no
Packaged: 2026-06-11 10:53:03 UTC; kkelley
Author: Ken Kelley ORCID iD [aut, cre]
Maintainer: Ken Kelley <kkelley@nd.edu>
Repository: CRAN
Date/Publication: 2026-06-18 14:20:22 UTC

NDPalette: 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.

Author(s)

Maintainer: Ken Kelley kkelley@nd.edu (ORCID)

See Also

Useful links:


R Markdown HTML output in the Notre Dame colors

Description

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.

Usage

html_nd_document(css = NULL, ...)

Arguments

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 html_document (for example toc, toc_float, code_folding, or number_sections).

Details

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.

Value

An R Markdown output format object, for use in a document's output field.

Author(s)

Ken Kelley kkelley@nd.edu

See Also

nd_css and nd_css_path for the stylesheet itself, and html_document for the underlying format and its arguments.

Examples

# 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)
}


Look up Notre Dame colors by name or role

Description

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.

Usage

nd_color(..., role = NULL, brand = NULL)

Arguments

...

One or more color keys or display names (character), matched case-insensitively against the key and name columns of nd_colors, for example "navy" or "ND Blue". Supply either names here or a role/brand filter, not both.

role

Optional character vector of roles to keep: any of "primary", "secondary", "former", "tint", "informal", and "neutral".

brand

Optional character vector of brands to keep: "university", "athletics", and/or "none".

Details

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.

Value

An unnamed character vector of hexadecimal color strings.

Author(s)

Ken Kelley kkelley@nd.edu

See Also

nd_colors for the full table and nd_palette for the curated data palette.

Examples

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")


Notre Dame colors with brand and role labels

Description

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.

Usage

nd_colors

Format

A data frame with one row per color and the columns:

name

Display name, for example "ND Blue".

key

Short snake_case key for nd_color, for example "navy". Unique across the table.

hex

Hexadecimal color string, or NA for a color specified only as a Pantone ink (Metallic Dome Gold).

brand

"university", "athletics", or "none" (the informal backgrounds).

role

Role within the brand system: "primary", "secondary", "former", "tint", "informal", or "neutral".

white_safe

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.

pms

Pantone reference where the brand guidance documents one, otherwise NA.

description

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.

Details

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.

See Also

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.

Examples

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")]


Notre Dame stylesheet for R Markdown HTML output

Description

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.

Usage

nd_css(path = NULL, web_fonts = FALSE)

Arguments

path

Optional file path. When supplied, the stylesheet is written there (UTF-8) and the path is returned invisibly. When NULL (the default), the stylesheet is returned as a single character string.

web_fonts

Logical. When FALSE (the default), the stylesheet uses a system sans-serif font stack and adds no external resources. When TRUE, it adds a Google Fonts @import for two open-source typefaces close in feel to the brand fonts — Montserrat for body text and Zilla Slab for headings — and applies them. These are independent open-source fonts, not the licensed Notre Dame brand fonts, and the option requires a network connection when the page is viewed.

Details

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.

Value

A single character string of CSS when path is NULL; otherwise path, invisibly.

Use in Shiny

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.

Author(s)

Ken Kelley kkelley@nd.edu

See Also

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.

Examples

# 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)


Path to the Notre Dame stylesheet shipped with NDPalette

Description

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.

Usage

nd_css_path()

Details

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.

Value

A single character string: the path to nd.css inside the installed package.

Author(s)

Ken Kelley kkelley@nd.edu

See Also

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.

Examples

nd_css_path()
file.exists(nd_css_path())


Informal soft backgrounds (not Notre Dame brand colors)

Description

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.

Usage

nd_informal_tints

Format

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).

See Also

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.

Examples

nd_informal_tints

# A soft-yellow page background behind a Notre Dame plot.
nd_informal_tints[["soft_yellow"]]


Notre Dame color palette

Description

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.

Usage

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, ...)

Arguments

n

Number of colors to return. A single positive integer. When NULL (the default), the palette's canonical anchor set is returned: the thirteen Notre Dame colors for "nd", the ten colorblind-friendly colors for "nd_cvd", and the seven former colors for "former".

palette

Character string naming the palette. One of "nd" (the default), "nd_cvd", or "former". The aliases "ND" and "notre_dame" are accepted for "nd", and "colorblind" and "cvd" for "nd_cvd".

reverse

Logical. If TRUE, the returned colors (or the scale's color order) are reversed. Defaults to FALSE.

...

For the scale_*_nd functions, additional arguments passed to discrete_scale (for example name, labels, or guide).

Details

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().

Value

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.

Author(s)

Ken Kelley kkelley@nd.edu

See Also

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.

Examples

# 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()



Notre Dame color palettes

Description

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.

Usage

nd_palettes

Format

A named list of three character vectors of hexadecimal color strings, of lengths 13 (nd), 10 (nd_cvd), and 7 (former).

Details

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).

See Also

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.

Examples

nd_palettes$nd
nd_palettes$nd_cvd
nd_palettes$former


Notre Dame near-white brand tints

Description

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.

Usage

nd_tints

Format

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.

See Also

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.

Examples

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)


Preview a color palette

Description

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.

Usage

show_palette(x = nd_palette(), labels = TRUE, border = "white")

Arguments

x

A character vector of colors (hexadecimal strings or R color names). Defaults to the canonical Notre Dame anchor set, nd_palette().

labels

Controls the text drawn on each swatch. TRUE (the default) labels each swatch with its color value; FALSE draws no labels. A character vector, one element per color in x, labels the swatches with those strings instead, so a palette can be shown with readable names rather than hexadecimal values. Either way the text is drawn in black or white, whichever reads better against the swatch.

border

Color of the swatch borders, passed to rect. Defaults to "white"; use NA for no border.

Value

The input vector x, invisibly. Called for the side effect of drawing to the active graphics device.

Author(s)

Ken Kelley kkelley@nd.edu

See Also

nd_palette

Examples

# 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"))