pub enum BlendMode {
Show 30 variants
Clear,
Src,
Dst,
SrcOver,
DstOver,
SrcIn,
DstIn,
SrcOut,
DstOut,
SrcAtop,
DstAtop,
Xor,
Plus,
Modulate,
Screen,
Overlay,
Darken,
Lighten,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Multiply,
Hue,
Saturation,
Color,
Luminosity,
PlusDarker,
}Expand description
BlendMode controls how source pixels combine with destination pixels.
BlendMode::SrcOver is the default. Advanced modes that read destination
pixels may require an additional render-pass break and snapshot.
Variants§
Clear
Src
Dst
SrcOver
DstOver
SrcIn
DstIn
SrcOut
DstOut
SrcAtop
DstAtop
Xor
Plus
Plus adds source and destination, clamped at one: Core Graphics’
kCGBlendModePlusLighter and Core Animation’s plusL filter.
Over premultiplied colour it is R = min(1, S + D), alpha included
(CGContext.h); Core Image’s _plusLighter kernel is src + dst, so
the clamp is the target’s own and a float target keeps the sum, as
the blend unit does here.
Modulate
Screen
Overlay
Darken
Lighten
ColorDodge
ColorBurn
HardLight
SoftLight
Difference
Exclusion
Multiply
Hue
Saturation
Color
Luminosity
PlusDarker
PlusDarker adds source and destination toward black: Core
Graphics’ kCGBlendModePlusDarker, Core Animation’s plusD filter
and Core Image’s CIPlusDarkerCompositing. It is not one of
Flutter’s modes.
Over premultiplied colour it is Core Image’s _plusDarker kernel, as
CoreImage ships it in macOS 27: Ra = min(1, Sa + Da) and
Rc = Ra − min(1, (Sa − Sc) + (Da − Dc)), which for opaque colours
is R = max(0, 1 − ((1 − D) + (1 − S))) (the comment in
CGContext.h drops the outer 1 −; Core Graphics draws the kernel’s
values). A transparent source leaves the destination as it is, and
over a transparent destination the source shows unchanged. It reads
the destination, so like Overlay it breaks the render pass.
Implementations§
Trait Implementations§
impl Copy for BlendMode
impl Eq for BlendMode
impl StructuralPartialEq for BlendMode
Auto Trait Implementations§
impl Freeze for BlendMode
impl RefUnwindSafe for BlendMode
impl Send for BlendMode
impl Sync for BlendMode
impl Unpin for BlendMode
impl UnsafeUnpin for BlendMode
impl UnwindSafe for BlendMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.