hclr {admisc}R Documentation

Colors from the HCL spectrum

Description

Produces colors from the HCL (Hue Chroma Luminance) spectrum, based on the number of levels from a factor.

Usage

hclr(x, starth = 25, c = 50, l = 75, alpha = 1, fixup = TRUE)

Arguments

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

Details

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

Value

The RBG code for the corresponding HCL colors.

Author(s)

Adrian Dusa

Examples


aa <- sample(letters[1:5], 100, replace = TRUE)

hclr(aa)

# same with
hclr(5)

# or
hclr(table(aa))

[Package admisc version 0.35 Index]