1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// We can determine that two colors are equivalent if the Delta is less than
/// a certain value. Typically, two colors with a DE2000 value of less than 1.0
/// are considered indistinguishable.
///
use super::*;
use super::delta::Delta;

impl<T: Delta + Copy> PartialEq<T> for LabValue
where LabValue: From<T> {
    fn eq(&self, other: &T) -> bool {
        self.delta(*other, DE2000).value < 1.0
    }
}

impl<T: Delta + Copy> PartialEq<T> for LchValue
where LchValue: From<T> {
    fn eq(&self, other: &T) -> bool {
        self.delta(*other, DE2000).value < 1.0
    }
}

impl<T: Delta + Copy> PartialEq<T> for XyzValue
where XyzValue: From<T> {
    fn eq(&self, other: &T) -> bool {
        self.delta(*other, DE2000).value < 1.0
    }
}