Trait palette::IntoComponent[][src]

pub trait IntoComponent<T: Component> {
    fn into_component(self) -> T;
}
Expand description

Converts into a color component type, while performing the appropriate scaling, rounding and clamping.

use palette::IntoComponent;

// Scales the value up to u8::MAX while converting.
let u8_component: u8 = 1.0f32.into_component();
assert_eq!(u8_component, 255);

Required methods

Converts self into T, while performing the appropriate scaling, rounding and clamping.

Implementations on Foreign Types

Implementors