Trait ColorMix

Source
pub trait ColorMix<T, U>: Sized
where T: Into<Self>, U: Into<Self>,
{ // Required method fn mix(first: T, second: U, percentage: f64) -> Self; }
Expand description

Trait for calculating mixing two colors together.

This trait provides a static method which will receive two colours, and can output a Self which should be the result of both colours mixed by the given percentage (the percentage pertains to how much the second colour should apply to the first).

Required Methods§

Source

fn mix(first: T, second: U, percentage: f64) -> Self

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§

Source§

impl<T, U> ColorMix<T, U> for Lab
where Self: From<T> + From<U>,

Source§

impl<T, U> ColorMix<T, U> for LinearRgb
where Self: From<T> + From<U>,

Source§

impl<T, U> ColorMix<T, U> for Oklab
where Self: From<T> + From<U>,

Source§

impl<T, U> ColorMix<T, U> for Srgb
where Self: From<T> + From<U>,

Source§

impl<T, U> ColorMix<T, U> for XyzD50
where Self: From<T> + From<U>,

Source§

impl<T, U> ColorMix<T, U> for XyzD65
where Self: From<T> + From<U>,

Source§

impl<T, U, V> ColorMix<T, U> for V
where V: ColorMixPolar<T, U> + PolarColor + Sized, T: Into<V>, U: Into<V>,