# Struct deltae::color::LabValue
[−][src]

    pub struct LabValue {
        pub l: f32,
        pub a: f32,
        pub b: f32,
    }

Expand description

# CIEL*a*b*

The `LabValue` is the key component in calculating `DeltaE`

`Value` | `Color` | `Range`
--- | --- | ---
`L*` | `Light <---> Dark` | `0.0 <---> 100.0`
`a*` | `Green <---> Magenta` | `-128.0 <---> 128.0`
`b*` | `Blue <---> Yellow` | `-128.0 <---> 128.0`

## Fields

`l: f32`

Lightness

`a: f32`

Green - Magenta

`b: f32`

Blue - Yellow

## Implementations

[src]

### impl LabValue

[src]

#### pub fn new(l: f32, a: f32, b: f32) -> Result<LabValue, ValueError>

Returns a result of a LabValue from 3 `f32`s. Will return `Err()` if the values are out of range as determined by the `Validate` trait.

## Trait Implementations

[src]

### impl Clone for LabValue

[src]

#### fn clone(&self) -> LabValue

Returns a copy of the value. Read more

1.0.0[src]

#### fn clone_from(&mut self, source: &Self)

Performs copy-assignment from `source`. Read more

[src]

### impl Debug for LabValue

[src]

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

[src]

### impl Default for LabValue

[src]

#### fn default() -> LabValue

Returns the “default value” for a type. Read more

[src]

### impl<D: Delta + Copy> DeltaEq<D> for LabValue

[src]

#### fn delta_eq<T: Tolerance>(
&self,
other: D,
method: DEMethod,
tolerance: T
) -> bool

Return true if the value is less than or equal to the `Tolerance`

[src]

### impl Display for LabValue

[src]

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

[src]

### impl From<&'_ LabValue> for LabValue

[src]

#### fn from(lab: &LabValue) -> LabValue

Performs the conversion.

[src]

### impl From<&'_ LabValue> for LchValue

[src]

#### fn from(lab: &LabValue) -> LchValue

Performs the conversion.

[src]

### impl From<&'_ LabValue> for XyzValue

[src]

#### fn from(lab: &LabValue) -> XyzValue

Performs the conversion.

[src]

### impl From<&'_ LchValue> for LabValue

[src]

#### fn from(lch: &LchValue) -> LabValue

Performs the conversion.

[src]

### impl From<&'_ XyzValue> for LabValue

[src]

#### fn from(xyz: &XyzValue) -> LabValue

Performs the conversion.

[src]

### impl From<LabValue> for LchValue

[src]

#### fn from(lab: LabValue) -> LchValue

Performs the conversion.

[src]

### impl From<LabValue> for XyzValue

[src]

#### fn from(lab: LabValue) -> XyzValue

Performs the conversion.

[src]

### impl From<LchValue> for LabValue

[src]

#### fn from(lch: LchValue) -> LabValue

Performs the conversion.

[src]

### impl From<XyzValue> for LabValue

[src]

#### fn from(xyz: XyzValue) -> LabValue

Performs the conversion.

[src]

### impl FromStr for LabValue

#### type Err = ValueError

The associated error which can be returned from parsing.

[src]

#### fn from_str(s: &str) -> Result<LabValue, ValueError>

Parses a string `s` to return a value of this type. Read more

[src]

### impl PartialEq<LabValue> for LabValue

[src]

#### fn eq(&self, other: &LabValue) -> bool

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

[src]

#### fn ne(&self, other: &LabValue) -> bool

This method tests for `!=`.

[src]

### impl Round for LabValue

[src]

#### fn round_to(self, places: i32) -> LabValue

Rounds the value to a number of decimal places

[src]

### impl TryFrom<&'_ [f32; 3]> for LabValue

#### type Error = ValueError

The type returned in the event of a conversion error.

[src]

#### fn try_from(slice: &[f32; 3]) -> Result<LabValue, ValueError>

Performs the conversion.

[src]

### impl TryFrom<&'_ (f32, f32, f32)> for LabValue

#### type Error = ValueError

The type returned in the event of a conversion error.

[src]

#### fn try_from(tuple: &(f32, f32, f32)) -> Result<LabValue, ValueError>

Performs the conversion.

[src]

### impl TryFrom<(f32, f32, f32)> for LabValue

#### type Error = ValueError

The type returned in the event of a conversion error.

[src]

#### fn try_from(tuple: (f32, f32, f32)) -> Result<LabValue, ValueError>

Performs the conversion.

[src]

### impl Validate for LabValue

[src]

#### fn validate(self) -> Result<Self, ValueError>

Return `Err()` if the values are invalid

[src]

### impl Copy for LabValue

[src]

### impl StructuralPartialEq for LabValue

## Auto Trait Implementations

### impl RefUnwindSafe for LabValue

### impl Send for LabValue

### impl Sync for LabValue

### impl Unpin for LabValue

### impl UnwindSafe for LabValue

## Blanket Implementations

[src]

### impl<T> Any for T where
T: 'static + ?Sized,

[src]

#### pub fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more

[src]

### impl<T> Borrow<T> for T where
T: ?Sized,

[src]

#### pub fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

[src]

### impl<T> BorrowMut<T> for T where
T: ?Sized,

[src]

#### pub fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more

[src]

### impl<T> From<T> for T

[src]

#### pub fn from(t: T) -> T

Performs the conversion.

[src]

### impl<T, U> Into<U> for T where
U: From<T>,

[src]

#### pub fn into(self) -> U

Performs the conversion.

[src]

### impl<T> ToOwned for T where
T: Clone,

#### type Owned = T

The resulting type after obtaining ownership.

[src]

#### pub fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more

[src]

#### pub fn clone_into(&self, target: &mut T)

🔬 This is a nightly-only experimental API. (`toowned_clone_into`)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

[src]

### impl<T> ToString for T where
T: Display + ?Sized,

[src]

#### pub default fn to_string(&self) -> String

Converts the given value to a `String`. Read more

[src]

### impl<T, U> TryFrom<U> for T where
U: Into<T>,

#### type Error = Infallible

The type returned in the event of a conversion error.

[src]

#### pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.

[src]

### impl<T, U> TryInto<U> for T where
U: TryFrom<T>,

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

[src]

#### pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.