Enum peniko::Mix

source ·
#[repr(C)]
pub enum Mix {
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, Clip = 128,
}
Expand description

Defines the color mixing function for a blend operation.

Variants§

§

Normal = 0

Default attribute which specifies no blending. The blending formula simply selects the source color.

§

Multiply = 1

Source color is multiplied by the destination color and replaces the destination.

§

Screen = 2

Multiplies the complements of the backdrop and source color values, then complements the result.

§

Overlay = 3

Multiplies or screens the colors, depending on the backdrop color value.

§

Darken = 4

Selects the darker of the backdrop and source colors.

§

Lighten = 5

Selects the lighter of the backdrop and source colors.

§

ColorDodge = 6

Brightens the backdrop color to reflect the source color. Painting with black produces no change.

§

ColorBurn = 7

Darkens the backdrop color to reflect the source color. Painting with white produces no change.

§

HardLight = 8

Multiplies or screens the colors, depending on the source color value. The effect is similar to shining a harsh spotlight on the backdrop.

§

SoftLight = 9

Darkens or lightens the colors, depending on the source color value. The effect is similar to shining a diffused spotlight on the backdrop.

§

Difference = 10

Subtracts the darker of the two constituent colors from the lighter color.

§

Exclusion = 11

Produces an effect similar to that of the Difference mode but lower in contrast. Painting with white inverts the backdrop color; painting with black produces no change.

§

Hue = 12

Creates a color with the hue of the source color and the saturation and luminosity of the backdrop color.

§

Saturation = 13

Creates a color with the saturation of the source color and the hue and luminosity of the backdrop color. Painting with this mode in an area of the backdrop that is a pure gray (no saturation) produces no change.

§

Color = 14

Creates a color with the hue and saturation of the source color and the luminosity of the backdrop color. This preserves the gray levels of the backdrop and is useful for coloring monochrome images or tinting color images.

§

Luminosity = 15

Creates a color with the luminosity of the source color and the hue and saturation of the backdrop color. This produces an inverse effect to that of the Color mode.

§

Clip = 128

Clip is the same as normal, but the latter always creates an isolated blend group and the former can optimize that out.

Trait Implementations§

source§

impl Clone for Mix

source§

fn clone(&self) -> Mix

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mix

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Mix> for BlendMode

source§

fn from(mix: Mix) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Mix

source§

fn eq(&self, other: &Mix) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Mix

source§

impl Eq for Mix

source§

impl StructuralPartialEq for Mix

Auto Trait Implementations§

§

impl RefUnwindSafe for Mix

§

impl Send for Mix

§

impl Sync for Mix

§

impl Unpin for Mix

§

impl UnwindSafe for Mix

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.