Description Usage Arguments Value
View source: R/mpd_select_colours.R
This function takes a palette as a character vector of hexidecimal colours, and returns a smaller palette, attempting to maximize the mean perceptual distance (MPD) between the colours in the new palette. It uses CIELAB colorspace to map colour to a perceptually meaningful scale before maximizing distances
1 2 3 |
pal |
A palette as a character vector containing hexidecimal coded colours |
sat.thresh |
Minimum saturation of colours in resulting palette (between 0 and 1) |
light.thresh |
Maximum luminosity of colours in resulting palette (between 0 and 1) |
dark.thresh |
Minimum luminosity of colours in resulting palette (between 0 and 1) |
nreps |
The number of samples of the new colour palette to perform for brute force optimization of MPD |
ncolours |
The number of colours to select for the new palette |
nreturn |
The number of palettes to return |
If nreturn
> 1 then a list of length nreturn
, each element of which is a character vector of length ncolours consisting of hexidecimal colour codes,
else a character vector of length ncolours consisting of hexidecimal colour codes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.