Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

HLS

Create HLS Colors


Description

This function creates colors of class HLS; a subclass of the virtual color-class class.

Usage

HLS(H, L, S, names)

Arguments

H, L, S

These arguments give the hue, lightness, and saturation of the colors. The values can be provided in separate H, L and S vectors or in a three-column matrix passed as H.

names

A vector of names for the colors (by default the row names of H are used).

Details

This function creates colors in an HLS color space. The hues should lie between between 0 and 360, and the lightness and saturations should lie between 0 and 1.

HLS is a relative color space; it is a transformation of an RGB color space. Conversion of HLS colors to any other color space must first involve a conversion to a specific RGB color space, for example the standard sRGB color space (IEC standard 61966).

Value

An object of class HLS which inherits from class color.

Author(s)

Ross Ihaka

See Also

Examples

# A rainbow of full-intensity hues
HLS(seq(0, 360, length.out = 13)[-13], 0.5, 1)

colorspace

A Toolbox for Manipulating and Assessing Colors and Palettes

v2.0-1
BSD_3_clause + file LICENSE
Authors
Ross Ihaka [aut], Paul Murrell [aut] (<https://orcid.org/0000-0002-3224-8858>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>), Jason C. Fisher [aut] (<https://orcid.org/0000-0001-9032-8912>), Reto Stauffer [aut] (<https://orcid.org/0000-0002-3798-5507>), Claus O. Wilke [aut] (<https://orcid.org/0000-0002-7470-9261>), Claire D. McWhite [aut] (<https://orcid.org/0000-0001-7346-3047>), Achim Zeileis [aut, cre] (<https://orcid.org/0000-0003-0918-3766>)
Initial release
2021-05-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.