lucent: Convert Solid Colours to Translucence

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plotFuns.r

Description

Convert a vector of solid colours to a vector of translucent ones (or vice versa)

Usage

1
lucent(col.pal=1, a=1)

Arguments

col.pal

vector of colours

a

alpha transparency value (0 = fully transparent, 1 = opaque)

Details

The function acts as a small wrapper to the rgb function.

Value

Vector of transformed colours depending on the alpha transparancy value a.

Author(s)

Steve Martell, International Pacific Halibut Commission, Seattle WA

See Also

pickCol, testCol, col2rgb, rgb

Examples

1
2
3
4
5
6
7
8
local(envir=.PBSmodEnv,expr={
  oldpar = par(no.readonly=TRUE)
  pbsfun = function(clrs=c("moccasin",rainbow(3))){
    clrs = c(clrs,lucent(clrs,a=0.25))
    testCol(clrs); invisible() }
  pbsfun()
  par(oldpar)
})

PBSmodelling documentation built on Dec. 27, 2017, 5:03 p.m.