setTransparency {GCDkit}R Documentation

Setting transparency of plotting colours

Description

Sets transparency of plotting colours for selected samples. Alternatively, it just returns the hexadecimal code(s) of specified colour(s) with the desired degree of transparency.

Usage

    setTransparency(which.samples=NULL,transp=NULL,alpha=NULL,
    col.in="black",save=TRUE,GUI=FALSE)

Arguments

which.samples

list of samples; if NULL a dialogue is displayed

transp

numeric; transparency to be set

alpha

character; alpha value to be set (opacity)

col.in

numeric or character vector; colour specification(s)

save

logical; should be the result saved into labels$Colour?

GUI

logical; is the function called form within GUI?

Details

The transparency value has to fall between 1 (completely transparent) to 0 (opaque).

Alternatively, the so-called alpha channel can be specified, which can attain any hexadecimal number between 0 (completely transparent) to ff (opaque).

if GUI = TRUE, the samples can be selected based on combination of three searching mechanisms (by sample name/label, range or a Boolean condition) - see selectSamples for details.

Value

Returns (invisibly) hexadecimal codes of the colours with desired degree of transparency If 'save=TRUE' it also assigns 'labels$Colour' producing the new, partly transparent colour.

Warning

As a side product, plotting colours are converted to hexadecimal values, which are not easy to translate back to symbolic names.

Author(s)

Vojtěch Janoušek, vojtech.janousek@geology.cz

See Also

Colours by a single variable can be assigned by assignColLab, symbols and colours by groups simultaneously by assignSymbGroup. Uniform colours are obtained by assign1col. Table of available plotting colours is obtained by showColours.

Examples

    data(sazava)
    accessVar("sazava")
    
    # Affects the colour of plotting symbols in the system (save=TRUE by default)
    setTransparency(transp=0.5)
    plotDiagram("TAS",FALSE)
    
    setTransparency(transp=0)
    setTransparency(which.samples=c("Sa-1","Sa-2","Sa-3"),transp=0.5)
    setTransparency(which.samples=c("Sa-1","Sa-2","Sa-3"),alpha="6a")
    plotDiagram("TAS",FALSE)
    figCex(2)
    
    # No labels assigned
    setTransparency(col=2,transp=0.5,save=FALSE)
    setTransparency(col=c("blue","red"),transp=0.5,save=FALSE)

[Package GCDkit version 6.1 Index]