#tweening #easing #animation #function #values #time #keyframe

easing-function

A Rusty implementation of easing functions for animation tweening

2 releases

0.1.1 Sep 1, 2024
0.1.0 Aug 18, 2024

#561 in Algorithms

Download history 61/week @ 2024-08-22 241/week @ 2024-08-29 166/week @ 2024-09-05 187/week @ 2024-09-12 185/week @ 2024-09-19 53/week @ 2024-09-26 119/week @ 2024-10-03 56/week @ 2024-10-10 148/week @ 2024-10-17 310/week @ 2024-10-24 327/week @ 2024-10-31 33/week @ 2024-11-07 78/week @ 2024-11-14 72/week @ 2024-11-21 73/week @ 2024-11-28 25/week @ 2024-12-05

250 downloads per month
Used in cushy

MIT/Apache

23KB
536 lines

easing-function

easing-function is considered alpha crate version Documentation for v0.1.1

A Rusty implementation of easing functions.

What is an Easing Function?

An easing function is a function that describes how to apply a change of a value over time. This library's easing functions expect input values between 0.0 and 1.0 and will return values corresponding to that range but may be outside of the range depending on the function.

Easing functions are typically used in animation systems to customize values produced between keyframes (tweening).

Why another easing functions crate?

When creating Cushy, no maintained library seemed to offer a trait-based solution to allow for custom easing functions in addition to the standard ones inspired by Robert Penner's original collection.

Using this crate

The EasingFunction type is the central type of this crate. It allows defining an easing function in two ways:

This crate also provides the standard set of easing functions in the [easings][easings] module (e.g., EaseInOutSine). Finally, the StandardEasings enum provides access to the standard easing functions through an enumeration. This enum also supports serde when enabling the serde feature of this crate.

Open-source Licenses

This project, like all projects from Khonsu Labs, is open-source. This repository is available under the MIT License or the Apache License 2.0.

To learn more about contributing, please see CONTRIBUTING.md.

Dependencies

~165KB