Learn R Programming

PlotTools (version 0.4.0)

Col2Hex: Colour to hexadecimal conversion

Description

Convert R colour to hexadecimal representation.

Usage

Col2Hex(col, alpha = FALSE)

Arguments

col

vector of any of the three kinds of R color specifications, i.e., either a color name (as listed by colors()), a hexadecimal string (see Details), or a positive integer i meaning palette()[i].

alpha

logical value indicating whether the alpha channel (opacity) values should be returned.

Examples

Run this code
Col2Hex(1:3)
Col2Hex(c("peachpuff", "blue"), TRUE)

Run the code above in your browser using DataLab