Simple Colour Manipulation
Overview
Functions for easily manipulating colours, creating colour scales and calculating colour distances.
- Names and dimnames are now supported for shade objects and can be set using the usual accessor functions. Names are initialised from standard colours where these are specified rather than a hex code, propagated through operations like concatenation and shown by swatch() as labels on each box. Dimnames are set automatically when a matrix is created by updating colour properties on a vector, and are shown by swatch() as axis labels.
- The new shades() convenience function is a variant of shade() that combines construction of shade objects with concatenation. It supports inline colour naming using standard argument names, and creating shade objects from source objects of different types.
- New colour property accessor function luminance() has been added, as has the contrast() function for (W3C) colour contrast.
Show all changes in 1.5.0Hide the rest of the changes in 1.5.0
- There is now full support for the Oklab colour space.
- Empty shade vectors are now allowed and can be created with shade().
- The swatch() function gains extra parameters for controlling additional aspects of the plot.
- The argument to function objects created by gradient() is now called n rather than steps, for compatibility with tinyplot.
- The tinytest package is now used for testing.
- The README now includes an example of using shades with tinyplot, as well as ggplot2.
- A small roxygen issue has been fixed (#9).
From NEWS in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-08
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 12
- Examples that run
- 100%11 run in a plain check
- Exported functions with examples
- 92%
- Documented parameters
- 88%
- Return-value docs
- 92%
- Help pages citing references
- 33%
Downloads
Repository
- PRs merged (all time)
- 80%
- Median days to close, 50 most recently updated closed issues
- 8
- Median days to close, 50 most recently updated closed PRs
- 9
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
5 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/jonclayden/shades on 2026-10-22.
The R CMD check workflow runs on Linux and Windows
Dependencies
Installing shades adds no packages beyond those that come with R.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 1.5.0Latest2026-07-02 · current release · diff ↗ ·
added 4 exports
contrast, expect_equal_shades, luminance, shades - RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 1.4.02019-08-02 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 1.3.12019-01-07 · diff ↗
- 1.3.02018-11-19 · diff ↗
- 1.2.0
- RR 3.5.0 released · 2018-04-23
- 1.1.02018-02-06 · diff ↗
- 1.0.02018-01-10 · diff ↗ ·
removed 1 export
hueshiftadded 5 exports
chroma, delta, dichromat, hue, lightness
Package metadata
- First published
- 2016-01-06
- Total releases
- 9 / 10 yrs
- License
- BSD_3_clause + file LICENCE OSI
- Download size
- 35 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("shades")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.