Skip to main content

Lerp

Trait Lerp 

Source
pub trait Lerp: Copy {
    // Required method
    fn lerp(self, to: Self, t: f32) -> Self;
}
Expand description

Values a Tween can interpolate.

Required Methods§

Source

fn lerp(self, to: Self, t: f32) -> Self

Blends from self toward to at eased progress t in [0, 1].

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 f32

Source§

fn lerp(self, to: Self, t: f32) -> Self

Source§

impl Lerp for u8

Source§

fn lerp(self, to: Self, t: f32) -> Self

Source§

impl Lerp for u16

Source§

fn lerp(self, to: Self, t: f32) -> Self

Source§

impl<A: Lerp, B: Lerp> Lerp for (A, B)

Pairs blend componentwise on one shared eased clock — the natural shape for two-stop color ramps.

Source§

fn lerp(self, to: Self, t: f32) -> Self

Implementors§

Source§

impl Lerp for Color

RGB endpoints blend per channel; palette and default endpoints have no interpolable space, so they snap at the halfway point.