Skip to content

enum

Curve

pub enum Curve {
    Linear,
    Power(f64),
    Sine,
    Expo,
    Circ,
    Back(f64),
    Elastic { amplitude: f64, period: f64 },
    Bounce,
    Steps(u32),
    Bezier(f64, f64, f64, f64),
}

The shape of an easing curve, before its direction is applied.

Variants

Linear

Linear

A constant speed.

Power

Power(f64)

t^n.

Sine

Sine

A sine curve.

Expo

Expo

An exponential curve.

Circ

Circ

A circular curve.

Back

Back(f64)

Overshoots and comes back, by this much.

Elastic

Elastic { amplitude: f64, period: f64 }

Springs past and settles.

Bounce

Bounce

Bounces at the end.

Steps

Steps(u32)

Jumps in this many steps.

Bezier

Bezier(f64, f64, f64, f64)

A cubic Bézier, as CSS's cubic-bezier(x1, y1, x2, y2).

Trait implementations