pub trait Lerp: Copy {
// Required method
fn mix(from: Self, to: Self, p: i32) -> Self;
}Expand description
A type that goes between two of its values.
mix(from, to, p) is from + (to - from) * p / ONE, rounded to the
nearest with halves up: exactly from at 0 and exactly to at ONE.
Past them (an overshoot) it goes on in a line, and stops at the type’s
bounds: a u8, a colour’s channel, stops at 0 and 255.
It is not called lerp, because shuyi_ui’s Rgb has an inherent
lerp in f32.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".