cosmic::cosmic_theme::palette::color_difference

Trait Ciede2000

source
pub trait Ciede2000 {
    type Scalar;

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

Calculate the CIEDE2000 ΔE* (Delta E) color difference between two colors.

CIEDE2000 is a formula by the CIE that calculates a distance metric, ΔE* (also known as Delta E), as an estimate of perceived color distance or difference. CIEDE2000 is an improvement over ΔE (see DeltaE) for CIE L*a*b* and CIE L*C*h° (see Lab and Lch).

There is a “just noticeable difference” between two colors when the ΔE* is roughly greater than 1. Thus, the color difference is more suited for calculating small distances between colors as opposed to large differences.

Required Associated Types§

source

type Scalar

The type for the ΔE* (Delta E).

Required Methods§

source

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

Calculate the CIEDE2000 ΔE* (Delta E) color difference between self and other.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Wp, T> Ciede2000 for Lab<Wp, T>
where T: Real + RealAngle + One + Zero + Powi + Exp + Trigonometry + Abs + Sqrt + Arithmetics + PartialCmp + Hypot + Clone, <T as HasBoolMask>::Mask: LazySelect<T> + BitAnd<Output = <T as HasBoolMask>::Mask> + BitOr<Output = <T as HasBoolMask>::Mask>,

source§

impl<Wp, T> Ciede2000 for Lch<Wp, T>
where T: Real + RealAngle + One + Zero + Powi + Exp + Trigonometry + Abs + Sqrt + Arithmetics + PartialCmp + Clone, <T as HasBoolMask>::Mask: LazySelect<T> + BitAnd<Output = <T as HasBoolMask>::Mask> + BitOr<Output = <T as HasBoolMask>::Mask>, Lch<Wp, T>: IntoColorUnclamped<Lab<Wp, T>>,