| Title: | Colour Palette for Reading and Code, Inspired by Moby-Dick |
|---|---|
| Description: | The Pequod colour palette, named after the whaler in Herman Melville's Moby-Dick. Provides the full Log base scale from warm paper (Log 50) to deep ink (Log 950), eight crew accent hues with light and dark variants, and 'ggplot2' scales for discrete and continuous mapping. Designed for long-form reading and code, with low saturation and a consistent earth- pigment register. Full design rationale and accessibility notes at <https://tiagojct.eu/projects/pequod/>. |
| Authors: | Tiago Jacinto [aut, cre] (ORCID: <https://orcid.org/0000-0002-7897-1101>) |
| Maintainer: | Tiago Jacinto <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-05-30 08:55:10 UTC |
| Source: | https://github.com/tiagojct/pequod |
Returns a character vector of hex colours from a named Pequod palette. Supports both discrete selection (first 'n' colours) and continuous interpolation between the palette's stops.
palette_pequod( name = "log", n = NULL, type = c("discrete", "continuous"), reverse = FALSE, direction = 1 )palette_pequod( name = "log", n = NULL, type = c("discrete", "continuous"), reverse = FALSE, direction = 1 )
name |
Palette name; see Details. |
n |
Number of colours to return. Defaults to the full palette length. For 'type = "continuous"', any positive integer. |
type |
'"discrete"' takes the first 'n' colours (errors if 'n' exceeds the palette length). '"continuous"' interpolates 'n' colours across the full palette with [grDevices::colorRampPalette()]. |
reverse |
If 'TRUE', reverse the returned palette. |
direction |
'+1' (default) or '-1' to flip the palette. |
Available palettes:
The full 12-step Log base scale.
Log 50–400 (six warm steps).
Log 500–950 (six cool steps).
The eight crew accents, light variants.
The eight crew accents, dark variants.
Crew accents in syntax-role order — keyword, string, number, comment, function, type, constant, variable.
An unnamed character vector of hex codes of length 'n'.
palette_pequod("log") palette_pequod("crew", n = 5) palette_pequod("log-cool", n = 100, type = "continuous")palette_pequod("log") palette_pequod("crew", n = 5) palette_pequod("log-cool", n = 100, type = "continuous")
A list bundling the light and dark crew accents together with their suggested syntax roles.
pequod_crewpequod_crew
A list with three elements: 'light', 'dark', 'roles'.
Eight accent hues tuned to sit against the Log 950 ink surface.
pequod_crew_darkpequod_crew_dark
A named character vector of length 8.
Eight accent hues, each named after a character in *Moby-Dick*, tuned to sit against a Log 100 paper surface.
pequod_crew_lightpequod_crew_light
A named character vector of length 8.
The twelve-step base scale, from warm paper ('Log 50') to the night-before-the-storm ink of 'Log 950'. Warm on the paper side, cool on the ink side; the hinge sits between Log 500 (warm taupe) and Log 700 (cool sage).
pequod_logpequod_log
A named character vector of length 12 (hex codes).
Draws a strip of coloured rectangles with labels using base R graphics. Useful for seeing a palette before committing to it in an analysis.
pequod_preview(palette = "log", labels = TRUE)pequod_preview(palette = "log", labels = TRUE)
palette |
Palette name. See [palette_pequod()]. |
labels |
If ‘TRUE' (default) writes each colour’s label above the rectangle. |
The palette, invisibly.
pequod_preview("log") pequod_preview("crew")pequod_preview("log") pequod_preview("crew")
Interpolates across a Pequod palette with [ggplot2::scale_color_gradientn()]. Best used with the '"log"' or '"log-cool"' palettes, which are ordered from light to dark; the '"crew"' palettes are categorical and will not interpolate cleanly.
scale_color_pequod_c(palette = "log", reverse = FALSE, ...) scale_colour_pequod_c(palette = "log", reverse = FALSE, ...) scale_fill_pequod_c(palette = "log", reverse = FALSE, ...)scale_color_pequod_c(palette = "log", reverse = FALSE, ...) scale_colour_pequod_c(palette = "log", reverse = FALSE, ...) scale_fill_pequod_c(palette = "log", reverse = FALSE, ...)
palette |
Palette name. See [palette_pequod()]. |
reverse |
Reverse the palette order. |
... |
Further arguments passed to [ggplot2::scale_color_gradientn()] / [ggplot2::scale_fill_gradientn()]. |
A ggplot2 scale.
library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_pequod_c(palette = "log-cool")library(ggplot2) ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + geom_tile() + scale_fill_pequod_c(palette = "log-cool")
Wraps [palette_pequod()] in a [ggplot2::discrete_scale()] so it can be dropped into any ggplot that uses a discrete colour or fill aesthetic.
scale_color_pequod_d(palette = "crew", reverse = FALSE, direction = 1, ...) scale_colour_pequod_d(palette = "crew", reverse = FALSE, direction = 1, ...) scale_fill_pequod_d(palette = "crew", reverse = FALSE, direction = 1, ...)scale_color_pequod_d(palette = "crew", reverse = FALSE, direction = 1, ...) scale_colour_pequod_d(palette = "crew", reverse = FALSE, direction = 1, ...) scale_fill_pequod_d(palette = "crew", reverse = FALSE, direction = 1, ...)
palette |
Palette name. See [palette_pequod()]. |
reverse |
Reverse the palette order. |
direction |
'+1' (default) or '-1' to flip the palette. |
... |
Further arguments passed to [ggplot2::discrete_scale()]. |
A ggplot2 scale.
library(ggplot2) ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) + geom_point() + scale_color_pequod_d(palette = "crew")library(ggplot2) ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) + geom_point() + scale_color_pequod_d(palette = "crew")