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::{Rgb, Shade}; let a = Rgb::new(0.4, 0.4, 0.4); let b = Rgb::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.
Required Methods
fn lighten(&self, amount: Self::Scalar) -> Self
Lighten the color by amount
.
Provided Methods
fn darken(&self, amount: Self::Scalar) -> Self
Darken the color by amount
.
Implementors
impl<C: Shade> Shade for Alpha<C, C::Scalar>
impl<T: Float> Shade for Rgb<T>
impl<T: Float> Shade for Luma<T>
impl<T: Float> Shade for Xyz<T>
impl<T: Float> Shade for Lab<T>
impl<T: Float> Shade for Lch<T>
impl<T: Float> Shade for Hsv<T>
impl<T: Float> Shade for Hsl<T>
impl<T: Float> Shade for Color<T>