Col: Generate a transparent RGB color

View source: R/Col.R

ColR Documentation

Generate a transparent RGB color

Description

This function transforms a standard color (e.g. "red") into an transparent RGB-color (i.e. alpha-blend<1).

Usage

Col(col, alpha = 0.2, locate = 0)

Arguments

col

Color (numeric or character)

alpha

Degree of transparency (0,1)

locate

Choose colour (with mouse)

Details

This only works for certain graphics devices (Cairo-X11 (x11 as of R>=2.7), quartz, pdf, ...).

Value

A character vector with elements of 7 or 9 characters, '#' followed by the red, blue, green and optionally alpha values in hexadecimal (after rescaling to '0 ... 255').

Author(s)

Klaus K. Holst

Examples

plot(runif(1000),cex=runif(1000,0,4),col=Col(c("darkblue","orange"),0.5),pch=16)

lava documentation built on May 29, 2024, 3:10 a.m.