Last data update: 2014.03.03

R: Convert Solid Colours to Translucence
lucentR Documentation

Convert Solid Colours to Translucence

Description

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

Usage

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

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)
})

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PBSmodelling)
Error in library(PBSmodelling) : 
  there is no package called 'PBSmodelling'
Execution halted