Trait geng::prelude::ColorComponent
pub trait ColorComponent: Copy {
const ZERO: Self;
const HALF: Self;
const MAX: Self;
// Required methods
fn as_f32(self) -> f32;
fn from_f32(value: f32) -> Self;
// Provided methods
fn convert<U>(self) -> U
where U: ColorComponent { ... }
fn lerp(start: Self, end: Self, t: f32) -> Self { ... }
}
Expand description
A trait representing a color component in a color.
Required Associated Constants§
const ZERO: Self
const ZERO: Self
Min value (black)
const HALF: Self
const HALF: Self
Half value (gray)
const MAX: Self
const MAX: Self
Max value (white)
Required Methods§
Provided Methods§
fn convert<U>(self) -> Uwhere
U: ColorComponent,
fn convert<U>(self) -> Uwhere
U: ColorComponent,
Convert from one type to another
Object Safety§
This trait is not object safe.