Struct nannou_core::color::Xyz

source ·
#[repr(C)]
pub struct Xyz<Wp = D65, T = f32>
where T: Component + Float, Wp: WhitePoint,
{ pub x: T, pub y: T, pub z: T, pub white_point: PhantomData<Wp>, }
Expand description

The CIE 1931 XYZ color space.

XYZ links the perceived colors to their wavelengths and simply makes it possible to describe the way we see colors as numbers. It’s often used when converting from one color space to an other, and requires a standard illuminant and a standard observer to be defined.

Conversions and operations on this color space depend on the defined white point

Fields§

§x: T

X is the scale of what can be seen as a response curve for the cone cells in the human eye. Its range depends on the white point and goes from 0.0 to 0.95047 for the default D65.

§y: T

Y is the luminance of the color, where 0.0 is black and 1.0 is white.

§z: T

Z is the scale of what can be seen as the blue stimulation. Its range depends on the white point and goes from 0.0 to 1.08883 for the defautl D65.

§white_point: PhantomData<Wp>

The white point associated with the color’s illuminant and observer. D65 for 2 degree observer is used by default.

Implementations§

source§

impl<T> Xyz<D65, T>
where T: Component + Float,

source

pub fn new(x: T, y: T, z: T) -> Xyz<D65, T>

CIE XYZ with whtie point D65.

source§

impl<Wp, T> Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source

pub fn with_wp(x: T, y: T, z: T) -> Xyz<Wp, T>

CIE XYZ.

source

pub fn into_components(self) -> (T, T, T)

Convert to a (X, Y, Z) tuple.

source

pub fn from_components(_: (T, T, T)) -> Xyz<Wp, T>

Convert from a (X, Y, Z) tuple.

Trait Implementations§

source§

impl<Wp, T> AbsDiffEq for Xyz<Wp, T>

§

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> <Xyz<Wp, T> as AbsDiffEq>::Epsilon

The default tolerance to use when testing values that are close together. Read more
source§

fn abs_diff_eq( &self, other: &Xyz<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon ) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
source§

fn abs_diff_ne( &self, other: &Xyz<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon ) -> bool

The inverse of ApproxEq::abs_diff_eq.
source§

impl<Wp, T> Add<T> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the + operator.
source§

fn add(self, c: T) -> <Xyz<Wp, T> as Add<T>>::Output

Performs the + operation. Read more
source§

impl<Wp, T> Add for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the + operator.
source§

fn add(self, other: Xyz<Wp, T>) -> <Xyz<Wp, T> as Add>::Output

Performs the + operation. Read more
source§

impl<Wp, T> AddAssign<T> for Xyz<Wp, T>
where T: Component + Float + AddAssign, Wp: WhitePoint,

source§

fn add_assign(&mut self, c: T)

Performs the += operation. Read more
source§

impl<Wp, T> AddAssign for Xyz<Wp, T>
where T: Component + Float + AddAssign, Wp: WhitePoint,

source§

fn add_assign(&mut self, other: Xyz<Wp, T>)

Performs the += operation. Read more
source§

impl<Wp, T, P> AsMut<P> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, P: RawPixel<T> + ?Sized,

source§

fn as_mut(&mut self) -> &mut P

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<Wp, T, P> AsRef<P> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, P: RawPixel<T> + ?Sized,

source§

fn as_ref(&self) -> &P

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Wp, T> Clone for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn clone(&self) -> Xyz<Wp, T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<Wp, T> ComponentWise for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Scalar = T

The scalar type for color components.
source§

fn component_wise<F>(&self, other: &Xyz<Wp, T>, f: F) -> Xyz<Wp, T>
where F: FnMut(T, T) -> T,

Perform a binary operation on this and an other color.
source§

fn component_wise_self<F>(&self, f: F) -> Xyz<Wp, T>
where F: FnMut(T) -> T,

Perform a unary operation on this color.
source§

impl<Wp, T> Debug for Xyz<Wp, T>
where Wp: Debug + WhitePoint, T: Debug + Component + Float,

source§

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

Formats the value using the given formatter. Read more
source§

impl<Wp, T> Default for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn default() -> Xyz<Wp, T>

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

impl<'de, Wp, T> Deserialize<'de> for Xyz<Wp, T>
where T: Component + Float + Deserialize<'de>, Wp: WhitePoint,

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Xyz<Wp, T>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Wp, T> Div<T> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the / operator.
source§

fn div(self, c: T) -> <Xyz<Wp, T> as Div<T>>::Output

Performs the / operation. Read more
source§

impl<Wp, T> Div for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the / operator.
source§

fn div(self, other: Xyz<Wp, T>) -> <Xyz<Wp, T> as Div>::Output

Performs the / operation. Read more
source§

impl<Wp, T> DivAssign<T> for Xyz<Wp, T>
where T: Component + Float + DivAssign, Wp: WhitePoint,

source§

fn div_assign(&mut self, c: T)

Performs the /= operation. Read more
source§

impl<Wp, T> DivAssign for Xyz<Wp, T>
where T: Component + Float + DivAssign, Wp: WhitePoint,

source§

fn div_assign(&mut self, other: Xyz<Wp, T>)

Performs the /= operation. Read more
source§

impl<Wp, T> From<(T, T, T)> for Xyz<Wp, T>
where Wp: WhitePoint, T: Component + Float,

source§

fn from(components: (T, T, T)) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Alpha<Hsl<_S, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Alpha<Hsl<_S, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Alpha<Hsv<_S, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Alpha<Hsv<_S, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Alpha<Hwb<_S, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Alpha<Hwb<_S, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Alpha<Lab<Wp, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Alpha<Lab<Wp, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Alpha<Lch<Wp, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Alpha<Lch<Wp, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Alpha<Luma<_S, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: LumaStandard<WhitePoint = Wp>,

source§

fn from(color: Alpha<Luma<_S, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: RgbStandard, <_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Alpha<Rgb<_S, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Alpha<Xyz<Wp, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Alpha<Xyz<Wp, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Alpha<Yxy<Wp, T>, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Alpha<Yxy<Wp, T>, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Hsl<_S, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Hsl<_S, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Hsv<_S, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Hsv<_S, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, _S> From<Hwb<_S, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, _S: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Hwb<_S, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Lab<Wp, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Lab<Wp, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Lch<Wp, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Lch<Wp, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, S> From<Luma<S, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, S: LumaStandard<WhitePoint = Wp>,

source§

fn from(color: Luma<S, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T, S> From<Rgb<S, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint, S: RgbStandard, <S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Rgb<S, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
where S: RgbStandard, T: Component + Float,

source§

fn from( color: Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Alpha<Rgb<S, T>, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as LumaStandard>::WhitePoint, T>> for Alpha<Luma<S, T>, T>
where T: Component + Float, S: LumaStandard,

source§

fn from(color: Xyz<<S as LumaStandard>::WhitePoint, T>) -> Alpha<Luma<S, T>, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as LumaStandard>::WhitePoint, T>> for Luma<S, T>
where S: LumaStandard, T: Component + Float,

source§

fn from(color: Xyz<<S as LumaStandard>::WhitePoint, T>) -> Luma<S, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hsl<S, T>, T>
where T: Component + Float, S: RgbSpace,

source§

fn from(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Alpha<Hsl<S, T>, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hsv<S, T>, T>
where T: Component + Float, S: RgbSpace,

source§

fn from(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Alpha<Hsv<S, T>, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Alpha<Hwb<S, T>, T>
where T: Component + Float, S: RgbSpace,

source§

fn from(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Alpha<Hwb<S, T>, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Hsl<S, T>
where T: Component + Float, S: RgbSpace,

source§

fn from(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Hsl<S, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>
where T: Component + Float, S: RgbSpace,

source§

fn from(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Hsv<S, T>

Converts to this type from the input type.
source§

impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Hwb<S, T>
where T: Component + Float, S: RgbSpace,

source§

fn from(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Hwb<S, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Xyz<Wp, T>> for Alpha<Lab<Wp, T>, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Xyz<Wp, T>) -> Alpha<Lab<Wp, T>, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Xyz<Wp, T>> for Alpha<Lch<Wp, T>, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Xyz<Wp, T>) -> Alpha<Lch<Wp, T>, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Xyz<Wp, T>> for Alpha<Yxy<Wp, T>, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Xyz<Wp, T>) -> Alpha<Yxy<Wp, T>, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Xyz<Wp, T>> for Lab<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Xyz<Wp, T>) -> Lab<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Xyz<Wp, T>> for Lch<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Xyz<Wp, T>) -> Lch<Wp, T>

Converts to this type from the input type.
source§

impl<S, Wp, T> From<Xyz<Wp, T>> for Rgb<S, T>
where S: RgbStandard, T: Component + Float, Wp: WhitePoint, <S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,

source§

fn from(color: Xyz<Wp, T>) -> Rgb<S, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Xyz<Wp, T>> for Yxy<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(xyz: Xyz<Wp, T>) -> Yxy<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> From<Yxy<Wp, T>> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from(color: Yxy<Wp, T>) -> Xyz<Wp, T>

Converts to this type from the input type.
source§

impl<Wp, T> FromColor<Wp, T> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn from_xyz(color: Xyz<Wp, T>) -> Xyz<Wp, T>

Convert from XYZ color space
source§

fn from_rgb<_S>(color: Rgb<Linear<_S>, T>) -> Xyz<Wp, T>
where _S: RgbSpace<WhitePoint = Wp>,

Convert from RGB color space
source§

fn from_lab(color: Lab<Wp, T>) -> Xyz<Wp, T>

Convert from L*a*b* color space
source§

fn from_yxy(color: Yxy<Wp, T>) -> Xyz<Wp, T>

Convert from Yxy color space
source§

fn from_luma(color: Luma<Linear<Wp>, T>) -> Xyz<Wp, T>

Convert from Luma
source§

fn from_lch(inp: Lch<Wp, T>) -> Self

Convert from L*C*h° color space
source§

fn from_hsl<S>(inp: Hsl<S, T>) -> Self
where S: RgbSpace<WhitePoint = Wp>,

Convert from HSL color space
source§

fn from_hsv<S>(inp: Hsv<S, T>) -> Self
where S: RgbSpace<WhitePoint = Wp>,

Convert from HSV color space
source§

fn from_hwb<S>(inp: Hwb<S, T>) -> Self
where S: RgbSpace<WhitePoint = Wp>,

Convert from HWB color space
source§

impl<Wp, T> Into<(T, T, T)> for Xyz<Wp, T>
where Wp: WhitePoint, T: Component + Float,

source§

fn into(self) -> (T, T, T)

Converts this type into the (usually inferred) input type.
source§

impl<Wp, T> IntoColor<Wp, T> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn into_xyz(self) -> Xyz<Wp, T>

Convert into XYZ space
source§

fn into_yxy(self) -> Yxy<Wp, T>

Convert into Yxy color space
source§

fn into_lab(self) -> Lab<Wp, T>

Convert into L*a*b* color space
source§

fn into_lch(self) -> Lch<Wp, T>

Convert into L*C*h° color space
source§

fn into_rgb<S>(self) -> Rgb<Linear<S>, T>
where S: RgbSpace<WhitePoint = Wp>,

Convert into RGB color space.
source§

fn into_hsl<S>(self) -> Hsl<S, T>
where S: RgbSpace<WhitePoint = Wp>,

Convert into HSL color space
source§

fn into_hsv<S>(self) -> Hsv<S, T>
where S: RgbSpace<WhitePoint = Wp>,

Convert into HSV color space
source§

fn into_luma(self) -> Luma<Linear<Wp>, T>

Convert into Luma
source§

fn into_hwb<S>(self) -> Hwb<S, T>
where S: RgbSpace<WhitePoint = Wp>,

Convert into HWB color space
source§

impl<S> IntoLinSrgba<S> for Xyz<D65, S>
where S: Component + Float,

source§

fn into_lin_srgba(self) -> LinSrgba<S>

Convert self into RGBA.
source§

impl<Wp, T> Limited for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

fn is_valid(&self) -> bool

Check if the color’s components are within the expected ranges.
source§

fn clamp(&self) -> Xyz<Wp, T>

Return a new color where the components has been clamped to the nearest valid values.
source§

fn clamp_self(&mut self)

Clamp the color’s components to the nearest valid values.
source§

impl<Wp, T> Mix for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Scalar = T

The type of the mixing factor.
source§

fn mix(&self, other: &Xyz<Wp, T>, factor: T) -> Xyz<Wp, T>

Mix the color with an other color, by factor. Read more
source§

impl<Wp, T> Mul<T> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the * operator.
source§

fn mul(self, c: T) -> <Xyz<Wp, T> as Mul<T>>::Output

Performs the * operation. Read more
source§

impl<Wp, T> Mul for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the * operator.
source§

fn mul(self, other: Xyz<Wp, T>) -> <Xyz<Wp, T> as Mul>::Output

Performs the * operation. Read more
source§

impl<Wp, T> MulAssign<T> for Xyz<Wp, T>
where T: Component + Float + MulAssign, Wp: WhitePoint,

source§

fn mul_assign(&mut self, c: T)

Performs the *= operation. Read more
source§

impl<Wp, T> MulAssign for Xyz<Wp, T>
where T: Component + Float + MulAssign, Wp: WhitePoint,

source§

fn mul_assign(&mut self, other: Xyz<Wp, T>)

Performs the *= operation. Read more
source§

impl<Wp, T> PartialEq for Xyz<Wp, T>

source§

fn eq(&self, other: &Xyz<Wp, T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Wp, T> Pixel<T> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

const CHANNELS: usize = 3usize

The number of color channels.
source§

fn as_raw<P>(&self) -> &P
where P: RawPixel<T> + ?Sized,

Cast as a reference to raw color components.
source§

fn as_raw_mut<P>(&mut self) -> &mut P
where P: RawPixel<T> + ?Sized,

Cast as a mutable reference to raw color components.
source§

fn into_raw<P>(self) -> P
where P: RawPixelSized<T>,

Convert from raw color components.
source§

fn from_raw<P>(pixel: &P) -> &Self
where P: RawPixel<T> + ?Sized,

Cast from a reference to raw color components.
source§

fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
where P: RawPixel<T> + ?Sized,

Cast from a mutable reference to raw color components.
source§

fn from_raw_slice(slice: &[T]) -> &[Self]

Cast a slice of raw color components to a slice of colors. Read more
source§

fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]

Cast a mutable slice of raw color components to a mutable slice of colors. Read more
source§

fn into_raw_slice(slice: &[Self]) -> &[T]

Cast a slice of colors to a slice of raw color components. Read more
source§

fn into_raw_slice_mut(slice: &mut [Self]) -> &mut [T]

Cast a mutable slice of colors to a mutable slice of raw color components. Read more
source§

impl<Wp, T> RelativeEq for Xyz<Wp, T>

source§

fn default_max_relative() -> <T as AbsDiffEq>::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
source§

fn relative_eq( &self, other: &Xyz<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
source§

fn relative_ne( &self, other: &Xyz<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon ) -> bool

The inverse of ApproxEq::relative_eq.
source§

impl<Wp, T> Serialize for Xyz<Wp, T>
where T: Component + Float + Serialize, Wp: WhitePoint,

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Wp, T> Shade for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Scalar = T

The type of the lighten/darken amount.
source§

fn lighten(&self, amount: T) -> Xyz<Wp, T>

Lighten the color by amount.
source§

fn darken(&self, amount: Self::Scalar) -> Self

Darken the color by amount.
source§

impl<Wp, T> Sub<T> for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the - operator.
source§

fn sub(self, c: T) -> <Xyz<Wp, T> as Sub<T>>::Output

Performs the - operation. Read more
source§

impl<Wp, T> Sub for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

§

type Output = Xyz<Wp, T>

The resulting type after applying the - operator.
source§

fn sub(self, other: Xyz<Wp, T>) -> <Xyz<Wp, T> as Sub>::Output

Performs the - operation. Read more
source§

impl<Wp, T> SubAssign<T> for Xyz<Wp, T>
where T: Component + Float + SubAssign, Wp: WhitePoint,

source§

fn sub_assign(&mut self, c: T)

Performs the -= operation. Read more
source§

impl<Wp, T> SubAssign for Xyz<Wp, T>
where T: Component + Float + SubAssign, Wp: WhitePoint,

source§

fn sub_assign(&mut self, other: Xyz<Wp, T>)

Performs the -= operation. Read more
source§

impl<Wp, T> UlpsEq for Xyz<Wp, T>

source§

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
source§

fn ulps_eq( &self, other: &Xyz<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon, max_ulps: u32 ) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
source§

fn ulps_ne( &self, other: &Xyz<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon, max_ulps: u32 ) -> bool

The inverse of ApproxEq::ulps_eq.
source§

impl<Wp, T> Copy for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

impl<Wp, T> StructuralPartialEq for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

Auto Trait Implementations§

§

impl<Wp, T> RefUnwindSafe for Xyz<Wp, T>

§

impl<Wp, T> Send for Xyz<Wp, T>
where T: Send, Wp: Send,

§

impl<Wp, T> Sync for Xyz<Wp, T>
where T: Sync, Wp: Sync,

§

impl<Wp, T> Unpin for Xyz<Wp, T>
where T: Unpin, Wp: Unpin,

§

impl<Wp, T> UnwindSafe for Xyz<Wp, T>
where T: UnwindSafe, Wp: UnwindSafe,

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for D
where T: Component + Float, Swp: WhitePoint, Dwp: WhitePoint, S: IntoColor<Swp, T>, D: FromColor<Dwp, T>,

source§

fn adapt_from_using<M>(color: S, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
source§

fn adapt_from(color: S) -> Self

Convert the source color to the destination color using the bradford method by default
source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Component + Float, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T, U> ConvertFrom<T> for U
where U: From<T> + Limited,

source§

fn convert_from(t: T) -> U

Convert from T with values clamped to the color defined bounds Read more
source§

fn try_convert_from(t: T) -> Result<U, OutOfBounds<U>>

Convert from T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
source§

fn convert_unclamped_from(val: T) -> Self

Convert from T. The resulting color might be invalid in its color space Read more
source§

impl<T, U> ConvertInto<U> for T
where U: ConvertFrom<T>,

source§

fn convert_into(self) -> U

Convert into T with values clamped to the color defined bounds Read more
source§

fn convert_unclamped_into(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
source§

fn try_convert_into(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,