pub enum BlendMode {
Show 17 variants
SourceOver,
Plus,
Multiply,
Screen,
Darken,
Lighten,
Difference,
Exclusion,
Overlay,
HardLight,
SoftLight,
ColorDodge,
ColorBurn,
Hue,
Saturation,
Color,
Luminosity,
// some variants omitted
}Expand description
Linear-light layer blending, with explicit compositing space.
Separable modes evaluate straight linear channels with source-over alpha. Extended RGB is not gamut-clipped. Plus instead adds premultiplied RGB and clamps the summed alpha to one. Dodge/Burn retain their formula’s intrinsic endpoints and saturation; other modes extend their piecewise formulas without input clipping. Nonseparable modes use hue/saturation/luminosity replacement.
Variants§
SourceOver
Premultiplied source-over; the default.
Plus
Unclipped additive RGB with saturated additive alpha.
Multiply
Product of straight source and backdrop channels.
Screen
Source plus backdrop minus their product.
Darken
Minimum of straight source and backdrop channels.
Lighten
Maximum of straight source and backdrop channels.
Difference
Absolute difference of straight channels.
Exclusion
Source plus backdrop minus twice their product.
Overlay
Multiply or screen, selected by the backdrop channel at one half.
HardLight
Multiply or screen, selected by the source channel at one half.
SoftLight
Piecewise soft lighting, with the low-backdrop cubic and upper square root.
ColorDodge
Backdrop divided by one minus source, saturated above at one.
Nonpositive backdrop returns zero before source at or above one returns one.
ColorBurn
One minus the saturated ratio of one minus backdrop to source.
Backdrop at or above one returns one before nonpositive source returns zero.
Hue
Source hue with backdrop saturation and luminosity.
Saturation
Source saturation with backdrop hue and luminosity.
Color
Source hue/saturation with backdrop luminosity.
Luminosity
Source luminosity with backdrop hue/saturation.