make_transparent: Add transparency to a vector of colors

View source: R/make_transparent.R

make_transparentR Documentation

Add transparency to a vector of colors

Description

Add a transparency factor to each color in a vector of color names, using alpha on a scale of 0-255. Adapted from http://stackoverflow.com/questions/8047668/transparent-equivalent-of-given-color.

Usage

make_transparent(color_names, alpha = 100)

Arguments

color_names

vector of color names to be modified.

alpha

numeric, the alpha value, between 0 (completely transparent) and 255 (the original color). Passed to rgb.

Value

a character vector of the same length as color_names


mjdufort/miscHelpers documentation built on July 29, 2024, 6:14 p.m.