Trait cosmic::cosmic_theme::palette::stimulus::IntoStimulus
source · pub trait IntoStimulus<T> {
// Required method
fn into_stimulus(self) -> T;
}
Expand description
Converts into a stimulus color component type, while performing the appropriate scaling, rounding and clamping.
use palette::stimulus::IntoStimulus;
// Scales the value up to u8::MAX while converting.
let u8_component: u8 = 1.0f32.into_stimulus();
assert_eq!(u8_component, 255);
Required Methods§
sourcefn into_stimulus(self) -> T
fn into_stimulus(self) -> T
Converts self
into T
, while performing the appropriate scaling,
rounding and clamping.