Skip to main content

Animatable

Trait Animatable 

pub trait Animatable: Copy {
    const TOLERANCE: f64;

    // Required methods
    fn to_channels(self) -> [f64; 4];
    fn from_channels(channels: [f64; 4]) -> Self;
}
Expand description

A value a motion can carry: a point, a rect, a colour, an amount.

Required Associated Constants§

const TOLERANCE: f64

How close each channel must be to its target to count as arrived.

Required Methods§

fn to_channels(self) -> [f64; 4]

fn from_channels(channels: [f64; 4]) -> Self

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.

Implementations on Foreign Types§

§

impl Animatable for f32

§

const TOLERANCE: f64 = 1e-3

§

fn to_channels(self) -> [f64; 4]

§

fn from_channels(c: [f64; 4]) -> f32

§

impl Animatable for f64

§

const TOLERANCE: f64 = 1e-3

Fractions (an openness, an opacity) and other unit amounts.

§

fn to_channels(self) -> [f64; 4]

§

fn from_channels(c: [f64; 4]) -> f64

Implementors§

§

impl Animatable for Point

§

const TOLERANCE: f64 = PIXEL_TOLERANCE

§

impl Animatable for Rect

§

const TOLERANCE: f64 = PIXEL_TOLERANCE

§

impl Animatable for Size

§

const TOLERANCE: f64 = PIXEL_TOLERANCE

§

impl Animatable for AlphaColor<Srgb>

§

impl Animatable for Vec2

§

const TOLERANCE: f64 = PIXEL_TOLERANCE