Learn R Programming

colorplane (version 0.5.0)

alpha_channel: alpha_channel

Description

extract the alpha channel

Usage

alpha_channel(x, ...)

# S4 method for HexColorPlane alpha_channel(x, normalize = TRUE)

# S4 method for ConstantColorPlane alpha_channel(x, normalize = TRUE)

# S4 method for RGBColorPlane alpha_channel(x, normalize = TRUE)

Value

a numeric vector of alpha channel values

Arguments

x

the object to extract alpha channel from

...

extra args

normalize

divide by 255

Examples

Run this code
cp <- IntensityColorPlane(seq(1,5), cols=rainbow(25))
cl <- map_colors(cp, irange=c(0,50))
stopifnot(length(alpha_channel(cl)) == 5)

Run the code above in your browser using DataLab