[][src]Enum amethyst_rendy::palette::Color

pub enum Color<S = Srgb, T = f32> where
    S: RgbSpace,
    T: Float + Component
{ Luma(Luma<Linear<<S as RgbSpace>::WhitePoint>, T>), Rgb(Rgb<Linear<S>, T>), Xyz(Xyz<<S as RgbSpace>::WhitePoint, T>), Yxy(Yxy<<S as RgbSpace>::WhitePoint, T>), Lab(Lab<<S as RgbSpace>::WhitePoint, T>), Lch(Lch<<S as RgbSpace>::WhitePoint, T>), Hsv(Hsv<S, T>), Hsl(Hsl<S, T>), Hwb(Hwb<S, T>), }

A generic color type.

The Color may belong to any color space and it may change depending on which operation is performed. That makes it immune to the "without conversion" rule of the operations it supports. The color spaces are selected as follows:

It's not recommended to use Color when full control is necessary, but it can easily be converted to a fixed color space in those cases.

Variants

Luma(Luma<Linear<<S as RgbSpace>::WhitePoint>, T>)

Linear luminance.

Rgb(Rgb<Linear<S>, T>)

Linear RGB.

Xyz(Xyz<<S as RgbSpace>::WhitePoint, T>)

CIE 1931 XYZ.

Yxy(Yxy<<S as RgbSpace>::WhitePoint, T>)

CIE 1931 Yxy.

Lab(Lab<<S as RgbSpace>::WhitePoint, T>)

CIE L*a*b* (CIELAB).

Lch(Lch<<S as RgbSpace>::WhitePoint, T>)

CIE L*C*h°, a polar version of CIE L*a*b*.

Hsv(Hsv<S, T>)

Linear HSV, a cylindrical version of RGB.

Hsl(Hsl<S, T>)

Linear HSL, a cylindrical version of RGB.

Hwb(Hwb<S, T>)

Linear HWB, an intuitive cylindrical version of RGB.

Implementations

impl<T> Color<Srgb, T> where
    T: Component + Float
[src]

pub fn linear_y(luma: T) -> Color<Srgb, T>[src]

Linear luminance.

pub fn linear_rgb(red: T, green: T, blue: T) -> Color<Srgb, T>[src]

Linear RGB.

pub fn xyz(x: T, y: T, z: T) -> Color<Srgb, T>[src]

CIE XYZ.

pub fn yxy(x: T, y: T, luma: T) -> Color<Srgb, T>[src]

CIE Yxy.

pub fn lab(l: T, a: T, b: T) -> Color<Srgb, T>[src]

CIE L*a*b*.

pub fn lch(l: T, chroma: T, hue: LabHue<T>) -> Color<Srgb, T>[src]

CIE L*C*h°.

pub fn hsv(hue: RgbHue<T>, saturation: T, value: T) -> Color<Srgb, T>[src]

Linear HSV.

pub fn hsl(hue: RgbHue<T>, saturation: T, lightness: T) -> Color<Srgb, T>[src]

Linear HSL.

pub fn hwb(hue: RgbHue<T>, whiteness: T, balckness: T) -> Color<Srgb, T>[src]

Linear HWB.

Trait Implementations

impl<S, T> ApproxEq for Color<S, T> where
    S: RgbSpace,
    T: Float + Component + ApproxEq,
    <T as ApproxEq>::Epsilon: Float
[src]

type Epsilon = <T as ApproxEq>::Epsilon

Used for specifying relative comparisons.

impl<S, T> Blend for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

type Color = Rgb<Linear<S>, T>

The core color type. Typically Self for color types without alpha.

impl<S, T> Clone for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> Copy for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> Debug for Color<S, T> where
    S: Debug + RgbSpace,
    T: Debug + Float + Component,
    <S as RgbSpace>::WhitePoint: Debug
[src]

impl<S, T> Default for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Hsl<S, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Hsv<S, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Hwb<S, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Lab<<S as RgbSpace>::WhitePoint, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Lch<<S as RgbSpace>::WhitePoint, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Luma<Linear<<S as RgbSpace>::WhitePoint>, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Rgb<Linear<S>, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Xyz<<S as RgbSpace>::WhitePoint, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Alpha<Yxy<<S as RgbSpace>::WhitePoint, T>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Color<<S as RgbStandard>::Space, T>> for Alpha<Rgb<S, T>, T> where
    S: RgbStandard,
    T: Component + Float
[src]

impl<S, T> From<Color<<S as RgbStandard>::Space, T>> for Rgb<S, T> where
    S: RgbStandard,
    T: Component + Float
[src]

impl<S, T> From<Color<S, T>> for Hwb<S, T> where
    S: RgbSpace,
    T: Component + Float
[src]

impl<S, T> From<Color<S, T>> for Alpha<Hwb<S, T>, T> where
    S: RgbSpace,
    T: Component + Float
[src]

impl<S, T> From<Color<S, T>> for Alpha<Hsv<S, T>, T> where
    S: RgbSpace,
    T: Component + Float
[src]

impl<S, T> From<Color<S, T>> for Hsl<S, T> where
    S: RgbSpace,
    T: Component + Float
[src]

impl<S, T> From<Color<S, T>> for Hsv<S, T> where
    S: RgbSpace,
    T: Component + Float
[src]

impl<S, T> From<Color<S, T>> for Alpha<Hsl<S, T>, T> where
    S: RgbSpace,
    T: Component + Float
[src]

impl<S, T, _S> From<Color<_S, T>> for Luma<S, T> where
    S: LumaStandard,
    T: Component + Float,
    _S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Alpha<Lch<Wp, T>, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Alpha<Lab<Wp, T>, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Lab<Wp, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Yxy<Wp, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Xyz<Wp, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Alpha<Yxy<Wp, T>, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Lch<Wp, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<Wp, T, _S> From<Color<_S, T>> for Alpha<Xyz<Wp, T>, T> where
    T: Component + Float,
    Wp: WhitePoint,
    _S: RgbSpace<WhitePoint = Wp>, 
[src]

impl<S, T, _S> From<Color<_S, T>> for Alpha<Luma<S, T>, T> where
    S: LumaStandard,
    T: Component + Float,
    _S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>, 
[src]

impl<S, T> From<Hsl<S, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Hsv<S, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Hwb<S, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Lab<<S as RgbSpace>::WhitePoint, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Lch<<S as RgbSpace>::WhitePoint, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Luma<Linear<<S as RgbSpace>::WhitePoint>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Rgb<Linear<S>, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> GetHue for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

type Hue = LabHue<T>

The kind of hue unit this color space uses. Read more

impl<S, T> Hue for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

impl<S, T> Mix for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

type Scalar = T

The type of the mixing factor.

impl<S, T> Saturate for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

type Scalar = T

The type of the (de)saturation factor.

impl<S, T> Shade for Color<S, T> where
    S: RgbSpace,
    T: Float + Component
[src]

type Scalar = T

The type of the lighten/darken amount.

Auto Trait Implementations

impl<S, T> RefUnwindSafe for Color<S, T> where
    S: RefUnwindSafe,
    T: RefUnwindSafe,
    <S as RgbSpace>::WhitePoint: RefUnwindSafe

impl<S, T> Send for Color<S, T> where
    S: Send,
    T: Send,
    <S as RgbSpace>::WhitePoint: Send

impl<S, T> Sync for Color<S, T> where
    S: Sync,
    T: Sync,
    <S as RgbSpace>::WhitePoint: Sync

impl<S, T> Unpin for Color<S, T> where
    S: Unpin,
    T: Unpin,
    <S as RgbSpace>::WhitePoint: Unpin

impl<S, T> UnwindSafe for Color<S, T> where
    S: UnwindSafe,
    T: UnwindSafe,
    <S as RgbSpace>::WhitePoint: UnwindSafe

Blanket Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clone for T where
    T: Clone
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Supports<T> for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryDefault for T where
    T: Default

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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