translude: Using transparence to modify colors

Description Usage Arguments Value Author(s) Examples

View source: R/translude.R

Description

Modifies a color by playing on its transparence. Low alpha make the color more transparent while larger alpha make it opaque.

Usage

1
translude(colors, alpha = 0.6)

Arguments

colors

A color or an array where each element is a color.

alpha

Scalar taking values between 0 (fully transparent) and 1 (opaque).

Value

An array with the colors transluded with opacity alpha

Author(s)

Yann Richet yann.richet@irsn.fr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library("grid")
onecolor <- "blue"

shades.count <- 10

alpha_tab <- seq(from = 0, to = 1, length=shades.count)
result <- rep("",times = shades.count)

for(i in 1:shades.count) result[i] <- translude(colors=onecolor,alpha_tab[i])
plotCol(result,txt.col=result)

IRSN/RobustInv documentation built on Nov. 20, 2019, 10:46 p.m.