feat: expand color system to 53 colors/10 palettes, add grid/slide themes, and README gallery
R-CMD-check / R CMD check (push) Successful in 3m41s

Replace the 16-color / 3-palette system with the full Civilytics design
system: 53 named colors (full navy, ember, violet ramps plus teal, plum,
moss, brass supporting hues) and 10 visualization palettes (qual,
qual_warm, qual_cool, seq_ember, seq_navy, seq_violet, seq_paper_ink,
div_navy_ember, div_violet_ember).

Enrich theme_civilytics() with grid and paper_bg parameters, add
theme_civilytics_slide() for presentations, and load all four brand fonts
(Inter, Libre Franklin, Source Serif 4, JetBrains Mono).

Add README.Rmd with rendered gallery showing all palettes, theme
variants, grid options, dark/slide modes, facets, and scale usage.
This commit is contained in:
2026-05-19 10:35:32 -06:00
parent 099fff1d1d
commit 515bae8685
29 changed files with 1209 additions and 273 deletions
+9 -14
View File
@@ -2,28 +2,23 @@
% Please edit documentation in R/colors.R
\name{civilytics_pal}
\alias{civilytics_pal}
\title{Civilytics brand color palette}
\title{Civilytics palette function (closure)}
\usage{
civilytics_pal(name = "main", n = NULL)
civilytics_pal(name = "qual", reverse = FALSE)
}
\arguments{
\item{name}{Character. Palette name: `"main"`, `"sequential"`, or
`"diverging"`. Defaults to `"main"`.}
\item{name}{Character. Palette name. See `names(civilytics_palettes)`.}
\item{n}{Integer or `NULL`. Number of colors to return. If `NULL`, returns
all colors in the palette. If `n` exceeds the number of defined stops,
colors are interpolated via [grDevices::colorRampPalette()].}
\item{reverse}{Logical. Reverse the palette order. Default `FALSE`.}
}
\value{
A character vector of hex color codes.
A function that takes integer `n` and returns `n` hex color codes.
}
\description{
Returns a character vector of hex codes from a named Civilytics palette.
Available palettes: `"main"` (qualitative, up to 6), `"sequential"` (light
to dark navy), `"diverging"` (orange–neutral–navy).
Returns a closure `function(n)` suitable for passing to
[ggplot2::discrete_scale()] or similar scale constructors.
}
\examples{
civilytics_pal() # all 6 qualitative colors
civilytics_pal("sequential", n = 3)
civilytics_pal("diverging", n = 5)
pal_fn <- civilytics_pal("qual")
pal_fn(4)
}