Trait palette::convert::IntoColor [−][src]
pub trait IntoColor<T>: Sized { fn into_color(self) -> T; }
Expand description
A trait for converting a color into another, in a possibly lossy way.
U: IntoColor<T>
is implemented for every type T: FromColor<U>
.
See FromColor
for more details.
Required methods
fn into_color(self) -> T
fn into_color(self) -> T
Convert into T with values clamped to the color defined bounds
use palette::{Clamp, IntoColor, Lch, Srgb}; let rgb: Srgb = Lch::new(50.0, 100.0, -175.0).into_color(); assert!(rgb.is_within_bounds());