Trait 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§

source

fn into_stimulus(self) -> T

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

Implementations on Foreign Types§

source§

impl IntoStimulus<f32> for f64

source§

impl IntoStimulus<f32> for u8

source§

impl IntoStimulus<f32> for u16

source§

impl IntoStimulus<f32> for u32

source§

impl IntoStimulus<f32> for u64

source§

impl IntoStimulus<f32> for u128

source§

impl IntoStimulus<f64> for f32

source§

impl IntoStimulus<f64> for u8

source§

impl IntoStimulus<f64> for u16

source§

impl IntoStimulus<f64> for u32

source§

impl IntoStimulus<f64> for u64

source§

impl IntoStimulus<f64> for u128

source§

impl IntoStimulus<u8> for f32

source§

impl IntoStimulus<u8> for f64

source§

impl IntoStimulus<u8> for u16

source§

impl IntoStimulus<u8> for u32

source§

impl IntoStimulus<u8> for u64

source§

impl IntoStimulus<u8> for u128

source§

impl IntoStimulus<u16> for f32

source§

impl IntoStimulus<u16> for f64

source§

impl IntoStimulus<u16> for u8

source§

impl IntoStimulus<u16> for u32

source§

impl IntoStimulus<u16> for u64

source§

impl IntoStimulus<u16> for u128

source§

impl IntoStimulus<u32> for f32

source§

impl IntoStimulus<u32> for f64

source§

impl IntoStimulus<u32> for u8

source§

impl IntoStimulus<u32> for u16

source§

impl IntoStimulus<u32> for u64

source§

impl IntoStimulus<u32> for u128

source§

impl IntoStimulus<u64> for f32

source§

impl IntoStimulus<u64> for f64

source§

impl IntoStimulus<u64> for u8

source§

impl IntoStimulus<u64> for u16

source§

impl IntoStimulus<u64> for u32

source§

impl IntoStimulus<u64> for u128

source§

impl IntoStimulus<u128> for f32

source§

impl IntoStimulus<u128> for f64

source§

impl IntoStimulus<u128> for u8

source§

impl IntoStimulus<u128> for u16

source§

impl IntoStimulus<u128> for u32

source§

impl IntoStimulus<u128> for u64

Implementors§

source§

impl<T> IntoStimulus<T> for T