pub enum Easing {
Hold,
Linear,
EaseIn,
EaseOut,
EaseInOut,
Bezier {
p1: (f64, f64),
p2: (f64, f64),
},
}Expand description
Easing function applied to a keyframe interval.
Controls the shape of interpolation from one super::Keyframe to the
next. Each keyframe carries the easing used for the transition from that
keyframe to the subsequent one; the last keyframe’s easing is unused.
Individual easing functions are implemented across issues #352–#357.
Variants§
Hold
Hold: the value snaps to the next keyframe without interpolation.
Linear
Linear: constant-rate interpolation (y = t).
EaseIn
Cubic ease-in: slow start, fast end (y = t³).
EaseOut
Cubic ease-out: fast start, slow end (y = 1 − (1−t)³).
EaseInOut
Cubic ease-in-out: slow at both ends, fast middle (y = 3t² − 2t³).
Bezier
CSS-compatible cubic Bézier with two user-defined control points.
P0 = (0, 0) and P3 = (1, 1) are fixed; p1 and p2 define the curve
shape. Equivalent to the CSS cubic-bezier() function.