pub enum BlendMode {
Show 29 variants
Src,
Dst,
SrcOver,
DstOver,
SrcIn,
DstIn,
SrcOut,
DstOut,
SrcAtop,
DstAtop,
Xor,
Plus,
Modulate,
Multiply,
Screen,
Overlay,
Darken,
Lighten,
Clear,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Hue,
Saturation,
Color,
Luminosity,
}Expand description
How a source colour is combined with the destination underneath it.
The Porter–Duff set plus the separable blends, evaluated on premultiplied,
sRGB-encoded values. SrcOver is the ordinary “paint this on top” and the
default nearly everywhere; the rest exist because a mask or a colour filter is
often defined by one of them — a fade-out is DstIn, a tint is Modulate, a
highlight is Screen.
Variants§
Src
The source only; the destination is discarded.
Dst
The destination only; the source is discarded.
SrcOver
The source over the destination — the ordinary one.
DstOver
The destination over the source.
SrcIn
The source, kept only where the destination is opaque.
DstIn
The destination, kept only where the source is opaque.
SrcOut
The source, kept only where the destination is transparent.
DstOut
The destination, kept only where the source is transparent.
SrcAtop
The source over the destination, clipped to the destination’s shape.
DstAtop
The destination over the source, clipped to the source’s shape.
Xor
Whichever of the two is alone there.
Plus
The two added, clamped at white.
Modulate
The two multiplied, ignoring coverage — the classic tint, and what a
ShaderMask uses by default.
Multiply
The two multiplied, respecting coverage: always darker.
Screen
The inverse of multiplying the inverses: always lighter.
Overlay
Multiply where the destination is dark, Screen where it is light.
Darken
The darker of the two, per channel.
Lighten
The lighter of the two, per channel.
Clear
Nothing at all: both are dropped (milestone 646, as the rest below).
ColorDodge
The destination brightened by the inverse of the source.
ColorBurn
The destination darkened by the source.
HardLight
Multiply where the source is dark, Screen where it is light: Overlay with
the roles swapped.
SoftLight
A gentler HardLight: darkens or lightens the destination by the source.
Difference
The difference of the two, per channel: black where they match.
Exclusion
Like Difference, with less contrast.
Hue
The source’s hue, with the destination’s saturation and luminosity.
Saturation
The source’s saturation, with the destination’s hue and luminosity.
Color
The source’s hue and saturation, with the destination’s luminosity: a tint that keeps the light and shade.
Luminosity
The source’s luminosity, with the destination’s hue and saturation.