Trait palette::MixAssign

source ·
pub trait MixAssign {
    type Scalar;

    // Required method
    fn mix_assign(&mut self, other: Self, factor: Self::Scalar);
}
Expand description

Assigning linear color interpolation of two colors.

See also Mix.

use approx::assert_relative_eq;
use palette::{LinSrgb, MixAssign};

let mut a = LinSrgb::new(0.0, 0.5, 1.0);
let b = LinSrgb::new(1.0, 0.5, 0.0);

a.mix_assign(b, 0.5);
assert_relative_eq!(a, LinSrgb::new(0.5, 0.5, 0.5));

Required Associated Types§

source

type Scalar

The type of the mixing factor.

Required Methods§

source

fn mix_assign(&mut self, other: Self, factor: Self::Scalar)

Mix the color with an other color, by factor.

factor should be between 0.0 and 1.0, where 0.0 will result in the same color as self and 1.0 will result in the same color as other.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C> MixAssign for Alpha<C, C::Scalar>

§

type Scalar = <C as MixAssign>::Scalar

source§

impl<C, T> MixAssign for PreAlpha<C>
where C: MixAssign<Scalar = T> + Premultiply<Scalar = T>, T: Real + Zero + One + Clamp + Arithmetics + AddAssign + Clone,

§

type Scalar = T

source§

impl<S, T> MixAssign for Luma<S, T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T

source§

impl<S, T> MixAssign for Rgb<S, T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T

source§

impl<S, T> MixAssign for Hsl<S, T>

§

type Scalar = T

source§

impl<S, T> MixAssign for Hsv<S, T>

§

type Scalar = T

source§

impl<S, T> MixAssign for Hwb<S, T>

§

type Scalar = T

source§

impl<T> MixAssign for Cam16Jch<T>

§

type Scalar = T

source§

impl<T> MixAssign for Cam16Jmh<T>

§

type Scalar = T

source§

impl<T> MixAssign for Cam16Jsh<T>

§

type Scalar = T

source§

impl<T> MixAssign for Cam16Qch<T>

§

type Scalar = T

source§

impl<T> MixAssign for Cam16Qmh<T>

§

type Scalar = T

source§

impl<T> MixAssign for Cam16Qsh<T>

§

type Scalar = T

source§

impl<T> MixAssign for Cam16UcsJab<T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T

source§

impl<T> MixAssign for Cam16UcsJmh<T>

§

type Scalar = T

source§

impl<T> MixAssign for Okhsl<T>

§

type Scalar = T

source§

impl<T> MixAssign for Okhsv<T>

§

type Scalar = T

source§

impl<T> MixAssign for Okhwb<T>

§

type Scalar = T

source§

impl<T> MixAssign for Oklab<T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T

source§

impl<T> MixAssign for Oklch<T>

§

type Scalar = T

source§

impl<Wp, T> MixAssign for Hsluv<Wp, T>

§

type Scalar = T

source§

impl<Wp, T> MixAssign for Lab<Wp, T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T

source§

impl<Wp, T> MixAssign for Lch<Wp, T>

§

type Scalar = T

source§

impl<Wp, T> MixAssign for Lchuv<Wp, T>

§

type Scalar = T

source§

impl<Wp, T> MixAssign for Luv<Wp, T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T

source§

impl<Wp, T> MixAssign for Xyz<Wp, T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T

source§

impl<Wp, T> MixAssign for Yxy<Wp, T>
where T: Real + Zero + One + AddAssign + Arithmetics + Clamp + Clone,

§

type Scalar = T