Skip to main content

Lerp

Trait Lerp 

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

Trait for types that support linear interpolation.

Required Methods§

Source

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

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 Hsla

Source§

fn lerp(&self, target: &Hsla, t: f32) -> Hsla

Interpolate each channel linearly. Intended for transitions between near-grayscale UI colors (e.g. text colors), where hue interpolation is irrelevant.

Source§

impl Lerp for Pixels

Source§

fn lerp(&self, target: &Pixels, t: f32) -> Pixels

Source§

impl Lerp for Point<Pixels>

Source§

fn lerp(&self, target: &Point<Pixels>, t: f32) -> Point<Pixels>

Source§

impl Lerp for f32

Source§

fn lerp(&self, target: &f32, t: f32) -> f32

Implementors§