pub enum BlendMode {
Show 29 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,
}Expand description
Blend mode used for draw primitives.
This mirrors Jetpack Compose’s blend-mode vocabulary while the renderer
currently guarantees SrcOver and DstOut behavior.
Variants§
Clear
Clears the destination to transparent where the source draws.
Src
Replaces the destination with the source.
Dst
Keeps the destination and discards the source.
SrcOver
Draws the source over the destination. This is the default.
DstOver
Draws the destination over the source.
SrcIn
Keeps the source only where the destination is opaque.
DstIn
Keeps the destination only where the source is opaque.
SrcOut
Keeps the source only where the destination is transparent.
DstOut
Keeps the destination only where the source is transparent.
SrcAtop
Draws the source over the destination, only where the destination is opaque.
DstAtop
Draws the destination over the source, only where the source is opaque.
Xor
Keeps the source and the destination where the other is transparent.
Plus
Adds the source and destination colors and alphas.
Modulate
Multiplies the source and destination colors and alphas.
Screen
Inverts, multiplies and inverts again, which lightens the result.
Overlay
Multiplies or screens depending on the destination color, which raises contrast.
Darken
Keeps the darker color of each channel.
Lighten
Keeps the lighter color of each channel.
ColorDodge
Brightens the destination by the source color.
ColorBurn
Darkens the destination by the source color.
HardLight
Multiplies or screens depending on the source color.
SoftLight
A softer version of HardLight: darkens or lightens depending on the source color.
Difference
Subtracts the darker color from the lighter one in each channel.
Exclusion
Like Difference with lower contrast.
Multiply
Multiplies the source and destination colors, which darkens the result.
Hue
Takes the hue of the source with the saturation and luminosity of the destination.
Saturation
Takes the saturation of the source with the hue and luminosity of the destination.
Color
Takes the hue and saturation of the source with the luminosity of the destination.
Luminosity
Takes the luminosity of the source with the hue and saturation of the destination.
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
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more