powered by
given two color planes, generate a new color plane by blending the colors using the supplied alpha multiplier.
blend_colors(bottom, top, alpha)# S4 method for ColorPlane,ColorPlane,numeric blend_colors(bottom, top, alpha = 1)# S4 method for ColorPlane,ColorPlane,missing blend_colors(bottom, top)# S4 method for HexColorPlane,RGBColorPlane,numeric blend_colors(bottom, top, alpha)# S4 method for HexColorPlane,ConstantColorPlane,numeric blend_colors(bottom, top, alpha = 1)
# S4 method for ColorPlane,ColorPlane,numeric blend_colors(bottom, top, alpha = 1)
# S4 method for ColorPlane,ColorPlane,missing blend_colors(bottom, top)
# S4 method for HexColorPlane,RGBColorPlane,numeric blend_colors(bottom, top, alpha)
# S4 method for HexColorPlane,ConstantColorPlane,numeric blend_colors(bottom, top, alpha = 1)
a new ColorPlane instance with `top` and `bottom` alpha-blended.
ColorPlane
the bottom color plane
the top color plane
the alpha overlay value.
The functions in this package blend colors based on the "over" operator where `top` if foreground and `bottom` is background.
https://en.wikipedia.org/wiki/Alpha_compositing
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)
Run the code above in your browser using DataLab