Trait palette::Shade [] [src]

pub trait Shade: Sized {
    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

The type of the lighten/darken amount.

Required Methods

Lighten the color by amount.

Provided Methods

Darken the color by amount.