[][src]Trait nannou::color::Shade

pub trait Shade {
    type Scalar: Float;
    fn lighten(&self, amount: Self::Scalar) -> Self;

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

The Shade trait allows a color to be lightened or darkened.

use palette::{LinSrgb, Shade};

let a = LinSrgb::new(0.4, 0.4, 0.4);
let b = LinSrgb::new(0.6, 0.6, 0.6);

assert_eq!(a.lighten(0.1), b.darken(0.1));

Associated Types

type Scalar: Float

The type of the lighten/darken amount.

Loading content...

Required methods

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

Lighten the color by amount.

Loading content...

Provided methods

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

Darken the color by amount.

Loading content...

Implementors

impl<C> Shade for Alpha<C, <C as Shade>::Scalar> where
    C: Shade
[src]

type Scalar = <C as Shade>::Scalar

impl<S, T> Shade for Luma<S, T> where
    S: LumaStandard<TransferFn = LinearFn>,
    T: Component + Float
[src]

type Scalar = T

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

type Scalar = T

impl<S, T> Shade for Rgb<S, T> where
    S: RgbStandard<TransferFn = LinearFn>,
    T: Component + Float
[src]

type Scalar = T

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

type Scalar = T

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

type Scalar = T

impl<Wp, T> Shade for Lab<Wp, T> where
    T: Component + Float,
    Wp: WhitePoint
[src]

type Scalar = T

impl<Wp, T> Shade for Lch<Wp, T> where
    T: Component + Float,
    Wp: WhitePoint
[src]

type Scalar = T

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

type Scalar = T

impl<Wp, T> Shade for Yxy<Wp, T> where
    T: Component + Float,
    Wp: WhitePoint
[src]

type Scalar = T

Loading content...