add_trans: Add transparency to a color

View source: R/16_add_trans.R

add_transR Documentation

Add transparency to a color

Description

Add transparency to a color

Usage

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

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

mcsiple/mmrefpoints documentation built on June 17, 2022, 8:41 p.m.