The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Title: Government Analysis Function Recommended Accessible Colour Palette
Version: 1.0.0
Description: Government Analysis Function recommended colours for use in charts on gov.uk to help meet accessibility guidance.
License: MIT + file LICENSE
Depends: R (≥ 2.10)
Imports: dplyr, grDevices
Suggests: ggplot2, testthat (≥ 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
RoxygenNote: 7.2.3
NeedsCompilation: no
Packaged: 2023-09-06 08:37:26 UTC; daviel9
Author: Luke Davies [aut, cre], Charlotte Rowley [aut], The Office for National Statistics [cph]
Maintainer: Luke Davies <Luke.Davies@ons.gov.uk>
Repository: CRAN
Date/Publication: 2023-09-06 18:12:32 UTC

Analysis Function colour palette function

Description

Generate a colour palette based on the selected chart and colour_format type (hex/rgb).

Usage

af_colours(
  type = c("categorical", "duo", "sequential", "focus"),
  colour_format = "hex",
  n = 6
)

Arguments

type

Name of required palette. Choices are: categorical, duo, sequential, focus

colour_format

Type of colour code to return. Choices are: hex, rgb If omitted, returns hex code

n

Number of colours to return for categorical palette type (max 6). If omitted, uses all colours.

Value

A vector of colour codes

Examples

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

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.