css: CSS color specification

View source: R/parse_css.R

cssR Documentation

CSS color specification

Description

Converts colors specified as CSS strings into R colors. This includes all colors in the X11 specification of the W3C http://www.w3.org/TR/css3-color/#svg-color as well as rgb() and hsl() constructs (but, in this case, it is probably easier to use the functions rgb) and hsl directly).

Usage

css(x)

Arguments

x

string representing a color in CSS.

Value

A vector of colors specified as hex codes

See Also

parse_color for the general function to parse colors in various specifications (which this function calls internally) and convert_color to convert parsed colors to another model.

Other color specifications: cmyk(), hcl(), hex(), hsi(), hsl(), hsv(), lab(), parse_color(), rgb(), ryb(), temperature(), wavelength()

Examples

css("teal")
css(c("teal", "blanchedalmond"))
css("rgb(255, 100, 100)")
css("hsl(200, 50%, 50%)")

jiho/chroma documentation built on Nov. 26, 2022, 2:39 a.m.