Learn R Programming

glow (version 0.13.0)

additive_alpha: additive_alpha

Description

Simulates additive blending on a dark to light color scale.

Usage

additive_alpha(colors)

Value

A simulated additive scale of the input colors.

Arguments

colors

colors

Details

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.

Examples

Run this code
m_solid <- viridisLite::magma(12)
m_additive <- additive_alpha(m_solid)

Run the code above in your browser using DataLab