pub trait Lerp: Sized {
// Required method
fn lerp(&self, to: &Self, t: f64) -> Self;
}Expand description
Linear interpolation; t is already eased and may leave [0, 1]
(e.g. with back easings).
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Lerp for String
Typewriter: keeps the common prefix, deletes the rest of self during
the first part of the tween and types the rest of to afterwards. The
time split is proportional to the number of characters.
impl Lerp for String
Typewriter: keeps the common prefix, deletes the rest of self during
the first part of the tween and types the rest of to afterwards. The
time split is proportional to the number of characters.
Source§impl<T: Lerp + Clone> Lerp for Vec<T>
Element-wise when lengths match; otherwise snaps at the midpoint.
impl<T: Lerp + Clone> Lerp for Vec<T>
Element-wise when lengths match; otherwise snaps at the midpoint.
Implementors§
impl Lerp for BezPath
impl Lerp for Color
Interpolates in OKLab so that midpoints keep perceived lightness.
impl Lerp for Gradient
Same kind and stop count: points, offsets and colors interpolate. Otherwise the gradient switches at the midpoint.