hclr | R Documentation |
Produces colors from the HCL (Hue Chroma Luminance) spectrum, based on the number of levels from a factor.
hclr(x, starth = 25, c = 50, l = 75, alpha = 1, fixup = TRUE)
x |
Number of factor levels, or the factor itself, or a frequency distribution from a factor |
starth |
Starting point for the hue (in the interval 0 - 360) |
c |
chroma - color purity, small values produce dark and high values produce bright colors |
l |
color luminance - a number between 0 and 100 |
alpha |
color transparency, where 0 is a completely transparent color, up to 1 |
fixup |
logical, corrects the RGB values foto produce a realistic color |
Any value of h
outside the interval 0 - 360 is constrained to this interval using
modulo values. For instance, 410 is constrained to 50 = 410
The RBG code for the corresponding HCL colors.
Adrian Dusa
aa <- sample(letters[1:5], 100, replace = TRUE)
hclr(aa)
# same with
hclr(5)
# or
hclr(table(aa))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.