palette::color_difference

Trait DeltaE

Source
pub trait DeltaE {
    type Scalar;

    // Required method
    fn delta_e(self, other: Self) -> Self::Scalar;
}
Expand description

Calculate the ΔE color difference between two colors.

This represents the original ΔE formula for a color space. It’s often a Euclidean distance for perceptually uniform color spaces and may not always be the best option. See the color_difference module for more details and options.

Required Associated Types§

Source

type Scalar

The type for the distance value.

Required Methods§

Source

fn delta_e(self, other: Self) -> Self::Scalar

Calculate the ΔE color difference metric for self and other, according to the color space’s specification.

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> DeltaE for Cam16UcsJab<T>
where Self: EuclideanDistance<Scalar = T>, T: Sqrt,

Source§

impl<T> DeltaE for Cam16UcsJmh<T>
where Cam16UcsJab<T>: DeltaE<Scalar = T> + FromColorUnclamped<Self>,

Source§

impl<Wp, T> DeltaE for Lab<Wp, T>
where Self: EuclideanDistance<Scalar = T>, T: Sqrt,

Source§

impl<Wp, T> DeltaE for Lch<Wp, T>
where Lab<Wp, T>: FromColorUnclamped<Self> + DeltaE<Scalar = T>,