colorspace (version 0.9)

hex2RGB: Convert Hexadecimal Color Specifications To RGB Objects

Description

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

Usage

hex2RGB(x, gamma = 2.2)

Arguments

x
a vector of hexdecimal color descriptions.
gamma
the display gamma value. Passing a value of NA results in no gamma correction being applied.

Value

  • An RGB object describing the colours.

Details

This function converts device dependent color descriptions of the form "#RRGGBB" into device independent sRGB colour descriptions.

See Also

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

Examples

Run this code
rgb = hex2RGB(c("#FF0000","#00FF00", "#0000FF"))

Run the code above in your browser using DataLab