blend_colors {colorplane} | R Documentation |
blend two color planes
Description
given two color planes, generate a new color plane by blending the colors using the supplied alpha multiplier.
Usage
blend_colors(bottom, top, alpha)
## S4 method for signature 'ColorPlane,ColorPlane,numeric'
blend_colors(bottom, top, alpha = 1)
## S4 method for signature 'ColorPlane,ColorPlane,missing'
blend_colors(bottom, top)
## S4 method for signature 'HexColorPlane,RGBColorPlane,numeric'
blend_colors(bottom, top, alpha)
## S4 method for signature 'HexColorPlane,ConstantColorPlane,numeric'
blend_colors(bottom, top, alpha = 1)
Arguments
bottom |
the bottom color plane |
top |
the top color plane |
alpha |
the alpha overlay value. |
Details
The functions in this package blend colors based on the "over" operator where 'top' if foreground and 'bottom' is background.
Value
a new ColorPlane
instance with 'top' and 'bottom' alpha-blended.
References
https://en.wikipedia.org/wiki/Alpha_compositing
Examples
top <- IntensityColorPlane(1:5, cols=rainbow(5))
bottom <- IntensityColorPlane(1:5, cols=rev(rainbow(5)))
top <- map_colors(top)
bottom <- map_colors(bottom)
bc <- blend_colors(bottom, top, .5)
[Package colorplane version 0.5.0 Index]