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§
Sourcefn mix_normal(self, background: Self) -> Self
fn mix_normal(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Normal.
Sourcefn mix_multiply(self, background: Self) -> Self
fn mix_multiply(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Multiply.
Sourcefn mix_screen(self, background: Self) -> Self
fn mix_screen(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Screen.
Sourcefn mix_overlay(self, background: Self) -> Self
fn mix_overlay(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Overlay.
Sourcefn mix_darken(self, background: Self) -> Self
fn mix_darken(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Darken.
Sourcefn mix_lighten(self, background: Self) -> Self
fn mix_lighten(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Lighten.
Sourcefn mix_colordodge(self, background: Self) -> Self
fn mix_colordodge(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::ColorDodge.
Sourcefn mix_colorburn(self, background: Self) -> Self
fn mix_colorburn(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::ColorBurn.
Sourcefn mix_hardlight(self, background: Self) -> Self
fn mix_hardlight(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::HardLight.
Sourcefn mix_softlight(self, background: Self) -> Self
fn mix_softlight(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::SoftLight.
Sourcefn mix_difference(self, background: Self) -> Self
fn mix_difference(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Difference.
Sourcefn mix_exclusion(self, background: Self) -> Self
fn mix_exclusion(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::Exclusion.
Sourcefn mix_pluslighter(self, background: Self) -> Self
fn mix_pluslighter(self, background: Self) -> Self
MixAdjust self over background using the MixBlendMode::PlusLighter.
Sourcefn mix_hue(self, background: Self) -> Self
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.
Sourcefn mix_saturation(self, background: Self) -> Self
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.
Sourcefn mix_color(self, background: Self) -> Self
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.
Sourcefn mix_luminosity(self, background: Self) -> Self
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.
Sourcefn lighten<A: Into<Factor>>(self, amount: A) -> Self
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())Sourcefn darken<A: Into<Factor>>(self, amount: A) -> Self
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())Sourcefn desaturate<A: Into<Factor>>(self, amount: A) -> Self
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())Sourcefn with_lightness<L: Into<Factor>>(self, lightness: L) -> Self
fn with_lightness<L: Into<Factor>>(self, lightness: L) -> Self
Returns a copy of this color with a new lightness.
Provided Methods§
Sourcefn mix(self, mode: MixBlendMode, background: Self) -> Selfwhere
Self: Sized,
fn mix(self, mode: MixBlendMode, background: Self) -> Selfwhere
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".