Function ease
pub fn ease(x: f64, curve: f64) -> f64Expand description
Returns an “eased” value of x based on an easing function defined with curve. This easing function is based on an exponent. The curve can be any floating-point number, with specific values leading to the following behaviors:
- Lower than -1.0 (exclusive): Ease in-out
- -1.0: Linear
- Between -1.0 and 0.0 (exclusive): Ease out-in
- 0.0: Constant
- Between 0.0 to 1.0 (exclusive): Ease out
- 1.0: Linear
- Greater than 1.0 (exclusive): Ease inease() curve values cheatsheet
See also [method smoothstep]. If you need to perform more advanced transitions, use interpolate_value.