Trait palette::IntoComponent
source · [−]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
fn into_component(self) -> T
fn into_component(self) -> T
Converts self
into T
, while performing the appropriate scaling,
rounding and clamping.