cosmic::cosmic_theme::palette::chromatic_adaptation

Trait AdaptFrom

Source
pub trait AdaptFrom<S, Swp, Dwp, T>: Sized
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>,
{ // Required method fn adapt_from_using<M>(color: S, method: M) -> Self where M: TransformMatrix<T>; // Provided method fn adapt_from(color: S) -> Self { ... } }
Expand description

Trait to convert color from one reference white point to another

Converts a color from the source white point (Swp) to the destination white point (Dwp). Uses the bradford method for conversion by default.

Required Methods§

Source

fn adapt_from_using<M>(color: S, method: M) -> Self
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.

Provided Methods§

Source

fn adapt_from(color: S) -> Self

Convert the source color to the destination color using the bradford method by default.

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<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for D
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, S: IntoColorUnclamped<Xyz<Swp, T>>, D: FromColorUnclamped<Xyz<Dwp, T>>,