Trait palette::convert::IntoColor[][src]

pub trait IntoColor<T>: Sized {
    fn into_color(self) -> T;
}

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[src]

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());
Loading content...

Implementors

impl<T, U> IntoColor<U> for T where
    U: FromColor<T>, 
[src]

Loading content...