hex2RGB: Convert Hexadecimal Color Specifications to sRGB Objects

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/colorspace.R

Description

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

Usage

1

Arguments

x

a vector of hexadecimal color descriptions.

gamma

Whether to apply gamma-correction.

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").

Value

An sRGB object describing the colors.

Author(s)

Ross Ihaka

See Also

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

Examples

1
hex2RGB(c("#FF0000","#00FF00", "#0000FF50"))

Example output

     R G B
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1

colorspace documentation built on May 2, 2019, 12:49 p.m.