iwanthue {hues} | R Documentation |
Generate a colour palette by k-means clustering of CIE Lab colour space.
Description
Generate a palette of distinct colours through k-means clustering of CIE Lab colour space.
Usage
iwanthue(
n,
hmin = 0,
hmax = 360,
cmin = 0,
cmax = 180,
lmin = 0,
lmax = 100,
plot = FALSE,
random = FALSE
)
Arguments
n |
Numeric. The number of colours to generate. |
hmin |
Numeric, in the range |
hmax |
Numeric, in the range |
cmin |
Numeric, in the range |
cmax |
Numeric, in the range |
lmin |
Numeric, in the range |
lmax |
Numeric, in the range |
plot |
Logical. Should the colour swatches be plotted (using
|
random |
Logical. If |
Details
Note that iwanthue
currently doesn't support hmin
greater than
hmax
(which should be allowed, since hue is circular).
Value
A vector of n
colours (as hexadecimal strings), representing
centers of clusters determined through k-means clustering of the CIE Lab
colour space delimited by hmin
, hmax
, cmin
, cmax
, lmin
and
lmax
.
References
Examples follow those presented at iwanthue - colors for data scientists
See Also
Examples
iwanthue(5)
iwanthue(5, plot=TRUE)
iwanthue(5, 0, 240, 0, 24, 0, 100, plot=TRUE) # shades
iwanthue(5, 0, 360, 0, 54, 67, 100, plot=TRUE) # pastel
iwanthue(5, 0, 360, 54, 180, 27, 67, plot=TRUE) # pimp
iwanthue(5, 0, 360, 36, 180, 13, 73, plot=TRUE) # intense
iwanthue(3, 0, 300, 60, 180, 73, 100, plot=TRUE) # fluoro
iwanthue(3, 220, 260, 12, 150, 0, 53, plot=TRUE) # blue ocean