govuk_palette: Use GOV.UK colours

View source: R/colours.R

govuk_coloursR Documentation

Use GOV.UK colours

Description

Access the GOV.UK design system colour palette

Usage

govuk_colours

govuk_palette(pal = "categorical")

Arguments

pal

One of categorical (the default), blue, blrd, bldrd_dark, blyl, putq, or a colour name from govuk_colours

Format

An object of class character of length 34.

Details

The GOV.UK design system includes a colour palette, these can be accessed via the govuk_colours vector, it includes both Sass variable colour names (e.g. govuk-text-colour) as well as the named colour palette.

The GOV.UK colour scheme was not designed with data visualisation in mind. The govuk_palette function provides an opinionated selection of GOV.UK colours for use in charts (e.g. via ggplot2::scale_fill_manual()).

The categorical palette (the default) provides an opinonated set of six GOV.UK colours for use in categorical/qualitative palettes.

The blues palette orders the GOV.UK colour palettes blues from dark to light and can be used for sequential colour palettes. Alternatively you can supply a name from the govuk_colours vector to generate the end-points for a sequential palette using that colour (where the lightest colour is roughly a third lighter than the input colour).

There are also four opinionated palettes for use in a divergent scale, these all use an off-white (the mid-colour between GOV.UK light grey and white)

  • blrd which use GOV.UK blue and GOV.UK red as its end-points

  • blrd_dark which uses GOV.UK dark blue as its blue end-point and a darker red of the same hue as GOV.UK red as its red end-point

  • blyl which uses GOV.UK blue and GOV.UK yellow as its end-points

  • putq which uses GOV.UK purple and GOV.UK turquoise as its end-points

The categorical and divergent palettes have been checked for general support for users with colour blindness.

Value

A set of hexadecimal colours

Functions

  • govuk_colours: GOV.UK colour palette


co-analysis/govuk-hugo-r documentation built on June 23, 2022, 5:44 a.m.