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
Required Methods
Provided Methods
Implementors
impl<C: Shade> Shade for Alpha<C, C::Scalar> type Scalar = C::Scalar;
impl<S, T> Shade for Hsl<S, T> where
T: Component + Float,
S: RgbSpace, type Scalar = T;impl<S, T> Shade for Hsv<S, T> where
T: Component + Float,
S: RgbSpace, type Scalar = T;impl<S, T> Shade for Hwb<S, T> where
T: Component + Float,
S: RgbSpace, type Scalar = T;impl<Wp, T> Shade for Lab<Wp, T> where
T: Component + Float,
Wp: WhitePoint, type Scalar = T;impl<Wp, T> Shade for Lch<Wp, T> where
T: Component + Float,
Wp: WhitePoint, type Scalar = T;impl<S, T> Shade for Luma<S, T> where
T: Component + Float,
S: LumaStandard<TransferFn = LinearFn>, type Scalar = T;impl<S, T> Shade for Rgb<S, T> where
S: RgbStandard<TransferFn = LinearFn>,
T: Component + Float, type Scalar = T;impl<Wp, T> Shade for Xyz<Wp, T> where
T: Component + Float,
Wp: WhitePoint, type Scalar = T;impl<Wp, T> Shade for Yxy<Wp, T> where
T: Component + Float,
Wp: WhitePoint, type Scalar = T;impl<S, T> Shade for Color<S, T> where
T: Float + Component,
S: RgbSpace, type Scalar = T;