Learn R Programming

colorspace (version 1.4-0)

hex2RGB: Convert Hexadecimal Color Specifications to sRGB Objects

Description

This function takes a vector of strings of the form "#RRGGBB" (hexadecimal color descriptions) into sRGB objects.

Usage

hex2RGB(x, gamma = FALSE)

Arguments

x

a vector of hexadecimal color descriptions.

gamma

Whether to apply gamma-correction.

Value

An sRGB object describing the colors.

Details

This function converts device-dependent color descriptions of the form "#RRGGBB" into sRGB color descriptions (linearized if gamma is TRUE). The alpha channel will be ignored if given ("#RRGGBBAA").

See Also

hex, RGB, sRGB, HSV, XYZ, polarLAB, LUV, polarLUV.

Examples

Run this code
# NOT RUN {
hex2RGB(c("#FF0000","#00FF00", "#0000FF50"))
# }

Run the code above in your browser using DataLab