Trait cosmic::cosmic_theme::palette::IntoColor
source · pub trait IntoColor<T>: Sized {
// Required method
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§
sourcefn into_color(self) -> T
fn into_color(self) -> T
Convert into T with values clamped to the color defined bounds
use palette::{IsWithinBounds, IntoColor, Lch, Srgb};
let rgb: Srgb = Lch::new(50.0, 100.0, -175.0).into_color();
assert!(rgb.is_within_bounds());
Object Safety§
This trait is not object safe.