View source: R/glow_functions.r
additive_alpha | R Documentation |
Simulates additive blending on a dark to light color scale.
additive_alpha(colors)
colors |
colors |
In R plotting (both ggplot and base R) blending is performed by alpha blending, which is an averaging effect. When combining light and glow effects, additive blending is more appropriate.
This function simulates additive blending by increasing color on a color scale to compensate for the averaging effect of alpha blending.
Note: this function is only appropriate for dark to light color scales.
A simulated additive scale of the input colors.
m_solid <- viridisLite::magma(12)
m_additive <- additive_alpha(m_solid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.