display_palette: Displays a visual colour chart of a selected palette

View source: R/displayPalette.R

display_paletteR Documentation

Displays a visual colour chart of a selected palette

Description

Displays a visual colour chart of a selected palette based on the name of the palette.

Usage

display_palette(palette, gradient = FALSE, ...)

Arguments

palette

string, name of palette of interest

gradient

boolean to indicate whether palette should be standard colours or gradient. Default is gradient = FALSE

...

Additional arguments to pass to the extract_gradient function, such as number of colours to display in gradient palette

Details

Current DfT palettes available are main.palette, electric.brights, just.beachy, cycling.hills, mountain.train and clear.skies.

All palettes are available as either pre-set palettes of colours, or as gradients. Gradient palettes allow the user to select as many colour options as they like using the dots argument.

Examples

#Simple display of DfT palette example
display_palette(palette = "just.beachy")
#Simple display of DfT gradient palette example
display_palette(palette = "just.beachy", gradient = TRUE)
#Display of DfT gradient palette with specified length
display_palette(palette = "just.beachy", gradient = TRUE, n = 7)

department-for-transport/dftplotr documentation built on April 3, 2024, 3:55 p.m.