Government Analysis Function Recommended Accessible Colour Palette

Government Analysis Function recommended colours for use in charts on gov.uk to help meet accessibility guidance.


afcolours

Overview

afcolours is an R package which can be used produce the Analysis Function recommended colour palettes to help meet accessibility guidelines. See the Government Analysis Function website for more information.

afcolours can be used to return either hex or rgb codes using the colour_format argument

Installation

You can install the development version of afcolours from GitHub with:

# install.packages("devtools")
devtools::install_github("best-practice-and-impact/afcolours")

Example

This is a basic example of how to use afcolours with ggplot2:

library(afcolours)

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"))
}

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("afcolours")

1.0.0 by Luke Davies, 3 years ago


Browse source code at https://github.com/cran/afcolours


Authors: Luke Davies [aut, cre] , Charlotte Rowley [aut] , The Office for National Statistics [cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, grDevices

Suggests ggplot2, testthat


See at CRAN