XyzValue in deltae::color - Rust
Description: CIE 1931 XYZ
Keywords: rust, rustlang, rust-lang, XyzValue

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

    pub struct XyzValue {
        pub x: f32,
        pub y: f32,
        pub z: f32,
    }

Expand description

# CIE 1931 XYZ

Further Reading: https://en.wikipedia.org/wiki/CIE_1931_color_space

`Value` | `Color` | `Range`
--- | --- | ---
`X` | `RGB` | `0.0 <---> 1.0`
`Y` | `Luminance` | `0.0 <---> 1.0`
`Z` | `Blue` | `0.0 <---> 1.0`

## Fields

`x: f32`

X Value

`y: f32`

Y Value

`z: f32`

Z Value

## Implementations

[src]

### impl XyzValue

[src]

#### pub fn new(x: f32, y: f32, z: f32) -> Result<XyzValue, ValueError>

Returns a result of an XyzValue 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 XyzValue

[src]

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

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 XyzValue

[src]

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

Formats the value using the given formatter. Read more

[src]

### impl Default for XyzValue

[src]

#### fn default() -> XyzValue

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

[src]

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

[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 XyzValue

[src]

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

Formats the value using the given formatter. Read more

[src]

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

[src]

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

Performs the conversion.

[src]

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

[src]

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

Performs the conversion.

[src]

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

[src]

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

Performs the conversion.

[src]

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

[src]

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

Performs the conversion.

[src]

### impl From<LabValue> for XyzValue

[src]

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

Performs the conversion.

[src]

### impl From<LchValue> for XyzValue

[src]

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

Performs the conversion.

[src]

### impl From<XyzValue> for LabValue

[src]

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

Performs the conversion.

[src]

### impl From<XyzValue> for LchValue

[src]

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

Performs the conversion.

[src]

### impl FromStr for XyzValue

#### type Err = ValueError

The associated error which can be returned from parsing.

[src]

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

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

[src]

### impl PartialEq<XyzValue> for XyzValue

[src]

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

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

[src]

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

This method tests for `!=`.

[src]

### impl Round for XyzValue

[src]

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

Rounds the value to a number of decimal places

[src]

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

#### type Error = ValueError

The type returned in the event of a conversion error.

[src]

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

Performs the conversion.

[src]

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

#### type Error = ValueError

The type returned in the event of a conversion error.

[src]

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

Performs the conversion.

[src]

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

#### type Error = ValueError

The type returned in the event of a conversion error.

[src]

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

Performs the conversion.

[src]

### impl Validate for XyzValue

[src]

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

Return `Err()` if the values are invalid

[src]

### impl Copy for XyzValue

[src]

### impl StructuralPartialEq for XyzValue

## Auto Trait Implementations

### impl RefUnwindSafe for XyzValue

### impl Send for XyzValue

### impl Sync for XyzValue

### impl Unpin for XyzValue

### impl UnwindSafe for XyzValue

## 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.