| Type: | Package |
| Title: | Colour Palette for Reading and Code, Inspired by Moby-Dick |
| Version: | 0.1.1 |
| 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/. |
| License: | MIT + file LICENSE |
| URL: | https://tiagojct.eu/projects/pequod/, https://github.com/tiagojct/pequod |
| BugReports: | https://github.com/tiagojct/pequod/issues |
| Encoding: | UTF-8 |
| Depends: | R (≥ 4.0.0) |
| Imports: | ggplot2 (≥ 3.3.0), grDevices, graphics, stats |
| Suggests: | testthat (≥ 3.0.0), jsonlite |
| Config/testthat/edition: | 3 |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | no |
| Packaged: | 2026-04-28 21:11:52 UTC; tiagojct |
| Author: | Tiago Jacinto |
| Maintainer: | Tiago Jacinto <tiagojacinto@med.up.pt> |
| Repository: | CRAN |
| Date/Publication: | 2026-04-29 18:40:02 UTC |
pequod: A Pigment-Inspired Colour Palette for R
Description
The Pequod colour palette for R — the full twelve-step Log base scale ('pequod_log'), eight crew accent hues in light and dark variants ('pequod_crew_light', 'pequod_crew_dark'), a general palette function ('palette_pequod()'), and ggplot2 scales ('scale_color_pequod_d()', 'scale_fill_pequod_d()', 'scale_color_pequod_c()', 'scale_fill_pequod_c()').
Details
See <https://tiagojct.eu/projects/pequod/> for the full palette narrative, WCAG contrast ratios, and colour-vision-deficiency analysis. The upstream source of truth is <https://github.com/tiagojct/pequod>.
Author(s)
Maintainer: Tiago Jacinto tiagojacinto@med.up.pt (ORCID)
See Also
Useful links:
Report bugs at https://github.com/tiagojct/pequod/issues
Pequod palette
Description
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.
Usage
palette_pequod(
name = "log",
n = NULL,
type = c("discrete", "continuous"),
reverse = FALSE,
direction = 1
)
Arguments
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. |
Details
Available palettes:
- '"log"'
The full 12-step Log base scale.
- '"log-warm"'
Log 50–400 (six warm steps).
- '"log-cool"'
Log 500–950 (six cool steps).
- '"crew"'
The eight crew accents, light variants.
- '"crew-dark"'
The eight crew accents, dark variants.
- '"syntax"'
Crew accents in syntax-role order — keyword, string, number, comment, function, type, constant, variable.
Value
An unnamed character vector of hex codes of length 'n'.
Examples
palette_pequod("log")
palette_pequod("crew", n = 5)
palette_pequod("log-cool", n = 100, type = "continuous")
Pequod crew metadata
Description
A list bundling the light and dark crew accents together with their suggested syntax roles.
Usage
pequod_crew
Format
A list with three elements: 'light', 'dark', 'roles'.
Pequod crew accents — dark variants
Description
Eight accent hues tuned to sit against the Log 950 ink surface.
Usage
pequod_crew_dark
Format
A named character vector of length 8.
Pequod crew accents — light variants
Description
Eight accent hues, each named after a character in *Moby-Dick*, tuned to sit against a Log 100 paper surface.
Usage
pequod_crew_light
Format
A named character vector of length 8.
Pequod Log base scale
Description
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).
Usage
pequod_log
Format
A named character vector of length 12 (hex codes).
Preview a Pequod palette
Description
Draws a strip of coloured rectangles with labels using base R graphics. Useful for seeing a palette before committing to it in an analysis.
Usage
pequod_preview(palette = "log", labels = TRUE)
Arguments
palette |
Palette name. See [palette_pequod()]. |
labels |
If ‘TRUE' (default) writes each colour’s label above the rectangle. |
Value
The palette, invisibly.
Examples
pequod_preview("log")
pequod_preview("crew")
Pequod continuous colour / fill scales for ggplot2
Description
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.
Usage
scale_color_pequod_c(palette = "log", reverse = FALSE, ...)
scale_colour_pequod_c(palette = "log", reverse = FALSE, ...)
scale_fill_pequod_c(palette = "log", reverse = FALSE, ...)
Arguments
palette |
Palette name. See [palette_pequod()]. |
reverse |
Reverse the palette order. |
... |
Further arguments passed to [ggplot2::scale_color_gradientn()] / [ggplot2::scale_fill_gradientn()]. |
Value
A ggplot2 scale.
Examples
library(ggplot2)
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
geom_tile() +
scale_fill_pequod_c(palette = "log-cool")
Pequod discrete colour / fill scales for ggplot2
Description
Wraps [palette_pequod()] in a [ggplot2::discrete_scale()] so it can be dropped into any ggplot that uses a discrete colour or fill aesthetic.
Usage
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, ...)
Arguments
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()]. |
Value
A ggplot2 scale.
Examples
library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) +
geom_point() +
scale_color_pequod_d(palette = "crew")