[][src]Trait nannou::color::FromColor

pub trait FromColor<T> where
    T: Float
{ fn from_xyz(Xyz<T>) -> Self; fn from_yxy(inp: Yxy<T>) -> Self { ... }
fn from_lab(inp: Lab<T>) -> Self { ... }
fn from_lch(inp: Lch<T>) -> Self { ... }
fn from_rgb(inp: Rgb<T>) -> Self { ... }
fn from_hsl(inp: Hsl<T>) -> Self { ... }
fn from_hsv(inp: Hsv<T>) -> Self { ... }
fn from_hwb(inp: Hwb<T>) -> Self { ... }
fn from_luma(inp: Luma<T>) -> Self { ... } }

FromColor provides conversion between the colors.

It requires from_xyz and derives conversion to other colors as a default from this. These defaults must be overridden when direct conversion exists between colors. For example, Luma has direct conversion to Rgb. So from_rgb conversion for Luma and from_luma for Rgb is implemented directly. The from for the same color must override the default. For example, from_rgb for Rgb will convert via Xyz which needs to be overridden with self to avoid the unnecessary converison.

Required methods

fn from_xyz(Xyz<T>) -> Self

Convert from XYZ color space

Loading content...

Provided methods

fn from_yxy(inp: Yxy<T>) -> Self

Convert from Yxy color space

fn from_lab(inp: Lab<T>) -> Self

Convert from Lab* color space

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

Convert from LCh° color space

fn from_rgb(inp: Rgb<T>) -> Self

Convert from RGB color space

fn from_hsl(inp: Hsl<T>) -> Self

Convert from HSL color space

fn from_hsv(inp: Hsv<T>) -> Self

Convert from HSV color space

fn from_hwb(inp: Hwb<T>) -> Self

Convert from HWB color space

fn from_luma(inp: Luma<T>) -> Self

Convert from Luma

Loading content...

Implementors

impl<T> FromColor<T> for Hwb<T> where
    T: Float
[src]

fn from_yxy(inp: Yxy<T>) -> Self[src]

fn from_lab(inp: Lab<T>) -> Self[src]

fn from_lch(inp: Lch<T>) -> Self[src]

fn from_rgb(inp: Rgb<T>) -> Self[src]

fn from_hsl(inp: Hsl<T>) -> Self[src]

fn from_luma(inp: Luma<T>) -> Self[src]

impl<T> FromColor<T> for Lab<T> where
    T: Float
[src]

fn from_yxy(inp: Yxy<T>) -> Self[src]

fn from_rgb(inp: Rgb<T>) -> Self[src]

fn from_hsl(inp: Hsl<T>) -> Self[src]

fn from_hsv(inp: Hsv<T>) -> Self[src]

fn from_hwb(inp: Hwb<T>) -> Self[src]

fn from_luma(inp: Luma<T>) -> Self[src]

impl<T> FromColor<T> for Lch<T> where
    T: Float
[src]

fn from_yxy(inp: Yxy<T>) -> Self[src]

fn from_rgb(inp: Rgb<T>) -> Self[src]

fn from_hsl(inp: Hsl<T>) -> Self[src]

fn from_hsv(inp: Hsv<T>) -> Self[src]

fn from_hwb(inp: Hwb<T>) -> Self[src]

fn from_luma(inp: Luma<T>) -> Self[src]

impl<T> FromColor<T> for Luma<T> where
    T: Float
[src]

fn from_lab(inp: Lab<T>) -> Self[src]

fn from_lch(inp: Lch<T>) -> Self[src]

fn from_hsl(inp: Hsl<T>) -> Self[src]

fn from_hsv(inp: Hsv<T>) -> Self[src]

fn from_hwb(inp: Hwb<T>) -> Self[src]

impl<T> FromColor<T> for Xyz<T> where
    T: Float
[src]

fn from_lch(inp: Lch<T>) -> Self[src]

fn from_hsl(inp: Hsl<T>) -> Self[src]

fn from_hsv(inp: Hsv<T>) -> Self[src]

fn from_hwb(inp: Hwb<T>) -> Self[src]

impl<T> FromColor<T> for Yxy<T> where
    T: Float
[src]

fn from_lab(inp: Lab<T>) -> Self[src]

fn from_lch(inp: Lch<T>) -> Self[src]

fn from_rgb(inp: Rgb<T>) -> Self[src]

fn from_hsl(inp: Hsl<T>) -> Self[src]

fn from_hsv(inp: Hsv<T>) -> Self[src]

fn from_hwb(inp: Hwb<T>) -> Self[src]

impl<T> FromColor<T> for Hsl<T> where
    T: Float
[src]

fn from_yxy(inp: Yxy<T>) -> Self[src]

fn from_lab(inp: Lab<T>) -> Self[src]

fn from_lch(inp: Lch<T>) -> Self[src]

fn from_hwb(inp: Hwb<T>) -> Self[src]

fn from_luma(inp: Luma<T>) -> Self[src]

impl<T> FromColor<T> for Hsv<T> where
    T: Float
[src]

fn from_yxy(inp: Yxy<T>) -> Self[src]

fn from_lab(inp: Lab<T>) -> Self[src]

fn from_lch(inp: Lch<T>) -> Self[src]

fn from_luma(inp: Luma<T>) -> Self[src]

impl<T> FromColor<T> for Rgb<T> where
    T: Float
[src]

fn from_yxy(inp: Yxy<T>) -> Self[src]

fn from_lab(inp: Lab<T>) -> Self[src]

fn from_lch(inp: Lch<T>) -> Self[src]

fn from_hwb(inp: Hwb<T>) -> Self[src]

Loading content...