col2hex: Convert R color strings to hex

Description Usage Arguments Examples

View source: R/mMisc.R

Description

Quickly create a hex string for a color + alpha channel

Usage

1
col2hex(basecol, achannel = "")

Arguments

basecol

An R base color name

achannel

(ideally) a hex value string for the alpha channel. Decimal values will be interpreted as hex

Examples

1
2
col2hex("lightsteelblue", "70")
sapply(brewer.pal(n = 5, name = "BuPu"), function(x) {col2hex(x, achannel = '80')})

townleym/mMisc documentation built on May 6, 2019, 10:52 a.m.