Trait palette::Mix [−][src]
A trait for linear color interpolation.
use approx::assert_relative_eq; use palette::{LinSrgb, Mix}; let a = LinSrgb::new(0.0, 0.5, 1.0); let b = LinSrgb::new(1.0, 0.5, 0.0); assert_relative_eq!(a.mix(&b, 0.0), a); assert_relative_eq!(a.mix(&b, 0.5), LinSrgb::new(0.5, 0.5, 0.5)); assert_relative_eq!(a.mix(&b, 1.0), b);
Associated Types
Loading content...Required methods
fn mix(&self, other: &Self, factor: Self::Scalar) -> Self
[src]
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
.
Implementors
impl<S, T> Mix for Luma<S, T> where
T: FloatComponent,
S: LumaStandard<TransferFn = LinearFn>,
[src]
impl<S, T> Mix for Luma<S, T> where
T: FloatComponent,
S: LumaStandard<TransferFn = LinearFn>,
[src]impl<S, T> Mix for Rgb<S, T> where
S: RgbStandard<TransferFn = LinearFn>,
T: FloatComponent,
[src]
impl<S, T> Mix for Rgb<S, T> where
S: RgbStandard<TransferFn = LinearFn>,
T: FloatComponent,
[src]impl<S, T> Mix for Hsl<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]
impl<S, T> Mix for Hsl<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]impl<S, T> Mix for Hsv<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]
impl<S, T> Mix for Hsv<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]impl<S, T> Mix for Hwb<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]
impl<S, T> Mix for Hwb<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]impl<Wp, T> Mix for Hsluv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Mix for Hsluv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]impl<Wp, T> Mix for Lab<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Mix for Lab<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]impl<Wp, T> Mix for Lch<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Mix for Lch<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]impl<Wp, T> Mix for Lchuv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Mix for Lchuv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]impl<Wp, T> Mix for Luv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Mix for Luv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]impl<Wp, T> Mix for Xyz<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Mix for Xyz<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]impl<Wp, T> Mix for Yxy<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Mix for Yxy<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]