MixAdjust

Trait MixAdjust 

Source
pub trait MixAdjust {
Show 22 methods // Required methods fn mix_normal(self, background: Self) -> Self; fn mix_multiply(self, background: Self) -> Self; fn mix_screen(self, background: Self) -> Self; fn mix_overlay(self, background: Self) -> Self; fn mix_darken(self, background: Self) -> Self; fn mix_lighten(self, background: Self) -> Self; fn mix_colordodge(self, background: Self) -> Self; fn mix_colorburn(self, background: Self) -> Self; fn mix_hardlight(self, background: Self) -> Self; fn mix_softlight(self, background: Self) -> Self; fn mix_difference(self, background: Self) -> Self; fn mix_exclusion(self, background: Self) -> Self; fn mix_pluslighter(self, background: Self) -> Self; fn mix_hue(self, background: Self) -> Self; fn mix_saturation(self, background: Self) -> Self; fn mix_color(self, background: Self) -> Self; fn mix_luminosity(self, background: Self) -> Self; fn lighten<A: Into<Factor>>(self, amount: A) -> Self; fn darken<A: Into<Factor>>(self, amount: A) -> Self; fn desaturate<A: Into<Factor>>(self, amount: A) -> Self; fn with_lightness<L: Into<Factor>>(self, lightness: L) -> Self; // Provided method fn mix(self, mode: MixBlendMode, background: Self) -> Self where Self: Sized { ... }
}
Expand description

Color mix and adjustment methods.

Required Methods§

Source

fn mix_normal(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Normal.

Source

fn mix_multiply(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Multiply.

Source

fn mix_screen(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Screen.

Source

fn mix_overlay(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Overlay.

Source

fn mix_darken(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Darken.

Source

fn mix_lighten(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Lighten.

Source

fn mix_colordodge(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::ColorDodge.

Source

fn mix_colorburn(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::ColorBurn.

Source

fn mix_hardlight(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::HardLight.

Source

fn mix_softlight(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::SoftLight.

Source

fn mix_difference(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Difference.

Source

fn mix_exclusion(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Exclusion.

Source

fn mix_pluslighter(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::PlusLighter.

Source

fn mix_hue(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Hue`.

This method converts both inputs to Hsla and the result back to Rgba.

Source

fn mix_saturation(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Saturation`.

This method converts both inputs to Hsla and the result back to Rgba.

Source

fn mix_color(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Color`.

This method converts both inputs to Hsla and the result back to Rgba.

Source

fn mix_luminosity(self, background: Self) -> Self

MixAdjust self over background using the MixBlendMode::Luminosity`.

This method converts both inputs to Hsla and the result back to Rgba.

Source

fn lighten<A: Into<Factor>>(self, amount: A) -> Self

Adds the amount to the color lightness.

§Examples

Add 10% of the current lightness to the DARK_RED color:

web_colors::DARK_RED.lighten(10.pct())
Source

fn darken<A: Into<Factor>>(self, amount: A) -> Self

Subtracts the amount from the color lightness.

§Examples

Removes 10% of the current lightness from the DARK_RED color:

web_colors::DARK_RED.darken(10.pct())
Source

fn desaturate<A: Into<Factor>>(self, amount: A) -> Self

Subtracts the amount from the color saturation.

§Examples

Removes 10% of the current saturation from the RED color:

colors::RED.desaturate(10.pct())
Source

fn with_lightness<L: Into<Factor>>(self, lightness: L) -> Self

Returns a copy of this color with a new lightness.

Provided Methods§

Source

fn mix(self, mode: MixBlendMode, background: Self) -> Self
where Self: Sized,

MixAdjust self over background using the mode.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§