add_trans: Add transparency to a color

Description Usage Arguments Details Value Examples

View source: R/16_add_trans.R

Description

Add transparency to a color

Usage

1
add_trans(color, trans)

Arguments

color

input color

trans

degree of transparency - a numeric values between 0 and 255 where 255 is fully visible)

Details

This function adds transparency to a color. It is originally by Tim Essington. Define transparency with an integer between 0 and 255, 0 being fully transparent and 255 being fully visible. Works with either color and trans a vector of equal length, or one of the two of length 1.

Value

a hex code for the transparent version of color

Examples

1
2
x <- add_trans("red", 100)
print(x)

ktmurray1219/mmrefpoints documentation built on Dec. 21, 2021, 8:40 a.m.