question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add more easing functions

See original GitHub issue

There are a number of ‘easing functions’ used by the animation system. At the top of _animator.py you will see the following:

EASING = {
    "none": lambda x: 1.0,
    "round": lambda x: 0.0 if x < 0.5 else 1.0,
    "linear": lambda x: x,
    "in_cubic": lambda x: x * x * x,
    "in_out_cubic": lambda x: 4 * x * x * x if x < 0.5 else 1 - pow(-2 * x + 2, 3) / 2,
    "out_cubic": lambda x: 1 - pow(1 - x, 3),
}

These function have been copied from https://easings.net/ and translated from Javascript to Python. I would like to add the remaining functions to the EASING dict above.

See the animation.py example as a way of testing the above functions.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
willmcgugancommented, Sep 5, 2021

No need for a donation! 😉

0reactions
rodrigogiraoserraocommented, Sep 5, 2021

I have a Buy Me a Coffee account (associated with my blog) where people can buy me a slice of pizza, maybe I’ll move it to ko-fi…

But I do not want Will’s coffee for this contribution, and I will refund it if needed 🤣

Read more comments on GitHub >

github_iconTop Results From Across the Web

<easing-function> - CSS: Cascading Style Sheets | MDN
The <easing-function> CSS data type denotes a mathematical function that describes the rate at which a numerical value changes.
Read more >
Understanding Easing Functions For CSS Animations And ...
Easing functions can change the look and feel of an animation by affecting the rate, or speed, of an animation.
Read more >
Help add new easing functions #507 - tweenjs/tween.js - GitHub
We could always use more easing functions. An easing function is single-variable function that maps values in the range [0, 1] to a...
Read more >
More Easing Functions Tutorial - JavaScript 2d canvas library
This tutorial demonstrates all of the easing function sets provided by Konva,including Linear, Ease, Back, Elastic, Bounce, and Strong.
Read more >
Ease-y Breezy: A Primer on Easing Functions | CSS-Tricks
The purpose of an easing function is to get non-linear values from linear value inputs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found