#[non_exhaustive]pub enum BlendMode {
Linear,
Screen,
Dodge,
Burn,
Overlay,
Multiply,
}Expand description
Blend mode for Grid::blit_alpha, selecting how source and destination colors combine
before the fg_alpha/bg_alpha factor is applied.
Linear is a straight per-channel color lerp, delegated to gem::Mix. The
remaining variants are the W3C separable blend modes libtcod also offers: each computes a
fully blended color per channel via alpha_blend::BlendMode (imported here under its old
name, SeparableBlendMode, to avoid colliding with this module’s own BlendMode), and
that result is what gets lerped against the destination by the alpha factor, in place of the
source color Linear would use.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Linear
Straight per-channel RGB lerp between destination and source.
Screen
Lightens: dst + src - dst * src. Always at least as light as either input.
Dodge
Brightens the destination to reflect the source (aka “color dodge”).
Burn
Darkens the destination to reflect the source (aka “color burn”).
Overlay
Multiplies or screens the colors, depending on the destination.
Multiply
Darkens: dst * src. Always at least as dark as either input; the complement of Screen.