additive_alpha: additive_alpha

View source: R/glow_functions.r

additive_alphaR Documentation

additive_alpha

Description

Simulates additive blending on a dark to light color scale.

Usage

additive_alpha(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.

Value

A simulated additive scale of the input colors.

Examples

m_solid <- viridisLite::magma(12)
m_additive <- additive_alpha(m_solid)

glow documentation built on April 6, 2023, 1:08 a.m.

Related to additive_alpha in glow...