#[non_exhaustive]#[repr(u8)]pub enum MixBlendMode {
Show 17 variants
Normal = 0,
Multiply = 1,
Screen = 2,
Overlay = 3,
Darken = 4,
Lighten = 5,
ColorDodge = 6,
ColorBurn = 7,
HardLight = 8,
SoftLight = 9,
Difference = 10,
Exclusion = 11,
Hue = 12,
Saturation = 13,
Color = 14,
Luminosity = 15,
PlusLighter = 16,
}Expand description
Color mix blend mode.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Normal = 0
The final color is the top color, regardless of what the bottom color is. The effect is like two opaque pieces of paper overlapping.
Multiply = 1
The final color is the result of multiplying the top and bottom colors. A black layer leads to a black final layer, and a white layer leads to no change. The effect is like two images printed on transparent film overlapping.
Screen = 2
The final color is the result of inverting the colors, multiplying them, and inverting that value. A black layer leads to no change, and a white layer leads to a white final layer. The effect is like two images shining onto a projection screen.
Overlay = 3
The final color is the result of Multiply if the bottom color is darker, or Screen if the bottom color is lighter.
This blend mode is equivalent to HardLight but with the layers swapped.
Darken = 4
The final color is composed of the darkest values of each color channel.
Lighten = 5
The final color is composed of the lightest values of each color channel.
ColorDodge = 6
The final color is the result of dividing the bottom color by the inverse of the top color.
A black foreground leads to no change.
A foreground with the inverse color of the backdrop leads to a fully lit color.
This blend mode is similar to Screen, but the foreground only needs to be as light as the inverse
of the backdrop to create a fully lit color.
ColorBurn = 7
The final color is the result of inverting the bottom color, dividing the value by the top color, and inverting that value.
A white foreground leads to no change. A foreground with the inverse color of the backdrop leads to a black final image.
This blend mode is similar to Multiply, but the foreground only needs to be as dark as the inverse of the backdrop
to make the final image black.
HardLight = 8
The final color is the result of Multiply if the top color is darker, or Screen if the top color is lighter.
This blend mode is equivalent to Overlay but with the layers swapped.
The effect is similar to shining a harsh spotlight on the backdrop.
The shorthand unit HardLight! converts into this.
SoftLight = 9
The final color is similar to HardLight, but softer. This blend mode behaves similar to HardLight.
The effect is similar to shining a diffused spotlight on the backdrop.
Difference = 10
The final color is the result of subtracting the darker of the two colors from the lighter one. A black layer has no effect, while a white layer inverts the other layer’s color.
Exclusion = 11
The final color is similar to Difference, but with less contrast.
As with Difference, a black layer has no effect, while a white layer inverts the other layer’s color.
Hue = 12
The final color has the hue of the top color, while using the saturation and luminosity of the bottom color.
Saturation = 13
The final color has the saturation of the top color, while using the hue and luminosity of the bottom color. A pure gray backdrop, having no saturation, will have no effect.
Color = 14
The final color has the hue and saturation of the top color, while using the luminosity of the bottom color. The effect preserves gray levels and can be used to colorize the foreground.
Luminosity = 15
The final color has the luminosity of the top color, while using the hue and saturation of the bottom color.
This blend mode is equivalent to Color, but with the layers swapped.
PlusLighter = 16
The final color adds the top color multiplied by alpha to the bottom color multiplied by alpha. This blend mode is particularly useful in cross fades where the opacity of both layers transition in reverse.
Trait Implementations§
Source§impl Clone for MixBlendMode
impl Clone for MixBlendMode
Source§fn clone(&self) -> MixBlendMode
fn clone(&self) -> MixBlendMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MixBlendMode
impl Debug for MixBlendMode
Source§impl Default for MixBlendMode
impl Default for MixBlendMode
Source§fn default() -> MixBlendMode
fn default() -> MixBlendMode
Source§impl<'de> Deserialize<'de> for MixBlendMode
impl<'de> Deserialize<'de> for MixBlendMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for MixBlendMode
impl Hash for MixBlendMode
Source§impl PartialEq for MixBlendMode
impl PartialEq for MixBlendMode
Source§impl Serialize for MixBlendMode
impl Serialize for MixBlendMode
impl Copy for MixBlendMode
impl Eq for MixBlendMode
impl StructuralPartialEq for MixBlendMode
Auto Trait Implementations§
impl Freeze for MixBlendMode
impl RefUnwindSafe for MixBlendMode
impl Send for MixBlendMode
impl Sync for MixBlendMode
impl Unpin for MixBlendMode
impl UnwindSafe for MixBlendMode
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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