pub enum BlendMode {
Show 18 variants
Src,
Dst,
SrcOver,
DstOver,
SrcIn,
DstIn,
SrcOut,
DstOut,
SrcAtop,
DstAtop,
Xor,
Plus,
Modulate,
Multiply,
Screen,
Overlay,
Darken,
Lighten,
}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.