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§
Required Methods§
Provided Methods§
Sourcefn convert<U>(self) -> Uwhere
U: ColorComponent,
fn convert<U>(self) -> Uwhere
U: ColorComponent,
Convert from one type to another
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.