pub trait Shade: Sized {
type Scalar: Float;
// Required method
fn lighten(&self, amount: Self::Scalar) -> Self;
// Provided method
fn darken(&self, amount: Self::Scalar) -> Self { ... }
}
Expand description
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));
Required Associated Types§
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.