Description Usage Arguments Details Value References See Also Examples
Generate a palette of distinct colours through k-means clustering of CIE Lab colour space.
1 2 3 4 5 6 7 8 9 10 11 |
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 |
Note that iwanthue
currently doesn't support hmin
greater than
hmax
(which should be allowed, since hue is circular).
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
.
Examples follow those presented at iwanthue - colors for data scientists
swatch
1 2 3 4 5 6 7 8 | 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
|
[1] "#503F44" "#964FB8" "#97B2B7" "#94BF58" "#C6624D"
[1] "#503F44" "#964FB8" "#97B2B7" "#94BF58" "#C6624D"
[1] "#C5CEC3" "#7A8177" "#2D4438" "#423122" "#020202"
[1] "#A7C8DA" "#C0D098" "#D9AFD5" "#DBBDA9" "#8BD7C1"
[1] "#9A40D2" "#C84784" "#6B6FC7" "#C55A37" "#6A9C36"
[1] "#BD623A" "#8E41C6" "#6E9A48" "#6977B8" "#BA4C7E"
[1] "#E3CF56" "#68DCD5" "#87E663"
[1] "#456D92" "#233C5D" "#3664BC"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.