pub struct DeltaE { /* private fields */ }
Expand description
§The measured difference between two colors
There are many different methods of calculating color difference. Different methods have a
specific purpose, mainly in determining the level of tolerance for describing the difference
between two colors. Regardless of the DEMethod
used, DeltaE
is always calculated based on the
LabValue
s of the two colors.
Implementations§
source§impl DeltaE
impl DeltaE
sourcepub fn with_method(self, method: DEMethod) -> Self
pub fn with_method(self, method: DEMethod) -> Self
Recalculate DeltaE
with another DEMethod
use deltae::{Delta, DeltaE, LabValue, DEMethod};
let lab0 = LabValue::new(89.73, 1.88, -6.96).unwrap();
let lab1 = LabValue::new(95.08, -0.17, -10.81).unwrap();
let de2000 = lab0.delta(lab1, DEMethod::DE2000);
let de1976 = de2000.with_method(DEMethod::DE1976);
assert_eq!(de1976, 6.902716);
sourcepub fn method(&self) -> &DEMethod
pub fn method(&self) -> &DEMethod
Return a reference to the DeltaE
method used in the calculation
Trait Implementations§
source§impl PartialEq for DeltaE
impl PartialEq for DeltaE
source§impl PartialOrd for DeltaE
impl PartialOrd for DeltaE
One should be careful when ordering DeltaE. A DE2000:1.0
value is not
necessarily the same amount of color difference as a amount of color
difference DE1976:1.0
value.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DeltaE
Auto Trait Implementations§
impl Freeze for DeltaE
impl RefUnwindSafe for DeltaE
impl Send for DeltaE
impl Sync for DeltaE
impl Unpin for DeltaE
impl UnwindSafe for DeltaE
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more