addalpha: Add transparency (alpha) to a vector of colours

View source: R/addalpha.R

addalphaR Documentation

Add transparency (alpha) to a vector of colours

Description

This function accepts a vector of colours and adds a given alpha to make them transparent.

Usage

addalpha(x, alpha = 1)

Arguments

x

A vector of colours (names, hex, etc)

alpha

The required alpha. 0 is fully transparent, 1 is fully opaque.

Value

A vector of colours of the same length as x, with transparency added.

Examples

addalpha(c("red", "green", "blue"), 0.3)
addalpha(rainbow(8), 0.6)


thlytras/Rivets documentation built on April 16, 2024, 5:43 a.m.