Title: | Government Analysis Function Recommended Accessible Colour Palette |
---|---|
Description: | Government Analysis Function recommended colours for use in charts on gov.uk to help meet accessibility guidance. |
Authors: | Luke Davies [aut, cre], Charlotte Rowley [aut], The Office for National Statistics [cph] |
Maintainer: | Luke Davies <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2025-02-28 02:45:32 UTC |
Source: | https://github.com/cran/afcolours |
Generate a colour palette based on the selected chart and colour_format type (hex/rgb).
af_colours( type = c("categorical", "duo", "sequential", "focus"), colour_format = "hex", n = 6 )
af_colours( type = c("categorical", "duo", "sequential", "focus"), colour_format = "hex", n = 6 )
type |
Name of required palette. Choices are:
|
colour_format |
Type of colour code to return. Choices are:
|
n |
Number of colours to return for categorical palette type (max 6). If omitted, uses all colours. |
A vector of colour codes
data <- data.frame(x = c(1,2), y = c(1,2), z = c("a","b") ) ggplot2::ggplot(data, ggplot2::aes(x = x, y = y, colour = z)) + ggplot2::geom_point() + ggplot2::scale_colour_manual(values = af_colours("duo"))
data <- data.frame(x = c(1,2), y = c(1,2), z = c("a","b") ) ggplot2::ggplot(data, ggplot2::aes(x = x, y = y, colour = z)) + ggplot2::geom_point() + ggplot2::scale_colour_manual(values = af_colours("duo"))