addAlpha: addAlpha()

Description Usage Arguments Value Examples

Description

Adds a specified opacity (between 0 and 1) to any color(s) listed.

Usage

1
addAlpha(col, alpha = 1)

Arguments

col

A vector of one or many colors.

alpha

A value between 0 and 1. 0 indicates complete transparency. 1 indicates complete opacity.

Value

Returns the Hexadecimal representation of the modified color(s).

Examples

1
2
3
4
5
6
7
8
9
## The function is currently defined as
function (col, alpha = 1) 
{
    if (missing(col)) 
        stop("Please provide a vector of colors.")
    apply(sapply(col, col2rgb)/255, 2, function(x) {
        rgb(x[1], x[2], x[3], alpha = alpha)
    })
  }

makeFlow documentation built on May 1, 2019, 9:25 p.m.