feat: add brand color system, showtext fonts, and dark theme
R-CMD-check / R CMD check (push) Failing after 1m39s
R-CMD-check / R CMD check (push) Failing after 1m39s
- R/colors.R: civilytics_colors named vector (from --cv-* CSS vars on civilytics.com), three palettes (main/sequential/diverging), scale_color_civilytics() and scale_fill_civilytics() for ggplot2 - R/fonts.R: auto-loads Inter + Libre Franklin from Google Fonts via showtext in .onLoad(); exports civilytics_load_fonts() for manual retry - R/theme.R: wires ggplot2 4.0 ink/paper/accent params into theme_grey() base, adds title_family + strip_color params; new theme_civilytics_dark() using navy_dark background and warm off-white text - R/logo.R: make_logo_grob(variant) accepts "light"/"dark" to select the white logo for dark-background compositions - DESCRIPTION: adds showtext, sysfonts; pins ggplot2 >= 4.0.0 - tests/testthat/test_theme.R: full test suite for colors, palettes, scales, both theme variants, and logo grob variants
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/colors.R
|
||||
\name{scale_color_civilytics}
|
||||
\alias{scale_color_civilytics}
|
||||
\title{Civilytics color scale for ggplot2}
|
||||
\usage{
|
||||
scale_color_civilytics(palette = "main", discrete = TRUE, ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{palette}{Character. Palette name passed to [civilytics_pal()].
|
||||
Defaults to `"main"`.}
|
||||
|
||||
\item{discrete}{Logical. `TRUE` (default) for a discrete scale; `FALSE` for
|
||||
a continuous gradient via [ggplot2::scale_color_gradientn()].}
|
||||
|
||||
\item{...}{Additional arguments passed to the underlying ggplot2 scale
|
||||
function.}
|
||||
}
|
||||
\value{
|
||||
A ggplot2 scale object.
|
||||
}
|
||||
\description{
|
||||
Applies a Civilytics brand palette to the `colour` aesthetic. Use
|
||||
`discrete = TRUE` for categorical variables and `discrete = FALSE` for
|
||||
continuous gradients.
|
||||
}
|
||||
\examples{
|
||||
library(ggplot2)
|
||||
ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||
geom_point() +
|
||||
scale_color_civilytics()
|
||||
|
||||
ggplot(mpg, aes(displ, hwy, colour = cty)) +
|
||||
geom_point() +
|
||||
scale_color_civilytics("sequential", discrete = FALSE)
|
||||
}
|
||||
Reference in New Issue
Block a user