View source: R/displayPalette.R
display_palette | R Documentation |
Displays a visual colour chart of a selected palette based on the name of the palette.
display_palette(palette, gradient = FALSE, ...)
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 |
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.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.