[][src]Trait nannou::draw::properties::color::SetColor

pub trait SetColor<S>: Sized where
    S: Float
{ fn rgba_mut(&mut self) -> &mut Option<Rgba<S>>; fn color<C>(self, color: C) -> Self
    where
        C: IntoRgba<S>
, { ... }
fn rgb(self, r: S, g: S, b: S) -> Self { ... }
fn rgba(self, r: S, g: S, b: S, a: S) -> Self { ... }
fn hsl(self, h: S, s: S, l: S) -> Self
    where
        S: Into<RgbHue<S>>
, { ... }
fn hsla(self, h: S, s: S, l: S, a: S) -> Self
    where
        S: Into<RgbHue<S>>
, { ... }
fn hsv(self, h: S, s: S, v: S) -> Self
    where
        S: Into<RgbHue<S>>
, { ... }
fn hsva(self, h: S, s: S, v: S, a: S) -> Self
    where
        S: Into<RgbHue<S>>
, { ... } }

Nodes that support setting colors.

Required methods

fn rgba_mut(&mut self) -> &mut Option<Rgba<S>>

Provide a mutable reference to the RGBA field which can be used for setting colors.

Loading content...

Provided methods

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 

Specify a color.

This method supports any color type that can be converted into RGBA.

Colors that have no alpha channel will be given an opaque alpha channel value 1.0.

fn rgb(self, r: S, g: S, b: S) -> Self

Specify the color via red, green and blue channels.

fn rgba(self, r: S, g: S, b: S, a: S) -> Self

Specify the color via red, green, blue and alpha channels.

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 

Specify the color via hue, saturation and luminance.

If you're looking for HSV or HSB, use the hsv method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 

Specify the color via hue, saturation, luminance and an alpha channel.

If you're looking for HSVA or HSBA, use the hsva method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 

Specify the color via hue, saturation and value (brightness).

This is sometimes also known as "hsb".

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 

Specify the color via hue, saturation, value (brightness) and an alpha channel.

This is sometimes also known as "hsba".

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

Loading content...

Implementations on Foreign Types

impl<S> SetColor<S> for Option<Rgba<S>> where
    S: Float
[src]

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 
[src]

fn rgb(self, r: S, g: S, b: S) -> Self[src]

fn rgba(self, r: S, g: S, b: S, a: S) -> Self[src]

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

Loading content...

Implementors

impl<S> SetColor<f32> for Ellipse<S>[src]

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 
[src]

fn rgb(self, r: S, g: S, b: S) -> Self[src]

fn rgba(self, r: S, g: S, b: S, a: S) -> Self[src]

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

impl<S> SetColor<f32> for Line<S>[src]

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 
[src]

fn rgb(self, r: S, g: S, b: S) -> Self[src]

fn rgba(self, r: S, g: S, b: S, a: S) -> Self[src]

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

impl<S> SetColor<f32> for Polygon<Fill, S>[src]

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 
[src]

fn rgb(self, r: S, g: S, b: S) -> Self[src]

fn rgba(self, r: S, g: S, b: S, a: S) -> Self[src]

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

impl<S> SetColor<f32> for Quad<S>[src]

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 
[src]

fn rgb(self, r: S, g: S, b: S) -> Self[src]

fn rgba(self, r: S, g: S, b: S, a: S) -> Self[src]

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

impl<S> SetColor<f32> for Rect<S>[src]

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 
[src]

fn rgb(self, r: S, g: S, b: S) -> Self[src]

fn rgba(self, r: S, g: S, b: S, a: S) -> Self[src]

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

impl<S> SetColor<f32> for Tri<S>[src]

fn color<C>(self, color: C) -> Self where
    C: IntoRgba<S>, 
[src]

fn rgb(self, r: S, g: S, b: S) -> Self[src]

fn rgba(self, r: S, g: S, b: S, a: S) -> Self[src]

fn hsl(self, h: S, s: S, l: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsla(self, h: S, s: S, l: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsv(self, h: S, s: S, v: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

fn hsva(self, h: S, s: S, v: S, a: S) -> Self where
    S: Into<RgbHue<S>>, 
[src]

Loading content...