@turboPasqual I’m the author of Ashley’s Light Fader (which you had also linked to), and if it might be helpful to anyone here, the formulas for the curves that I’m using are all freely available at easings.net:
In each of the formulas below, x represents the current linear percentage of the fade that has been completed, as a value from 0.0 to 1.0. And then what’s returned is a number—also from 0.0 to 1.0—that represents the current percentage after that particular curve has been applied.
Sine
- ease-in sine
return 1 - Math.cos((x * Math.PI) / 2); - ease-out sine
return 1 - Math.cos((x * Math.PI) / 2); - ease-in-out sine
return -(Math.cos(Math.PI * x) - 1) / 2;
Quad
- ease-in quad
return x * x; - ease-out quad
return 1 - (1 - x) * (1 - x); - ease-in-out quad
return x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2;
Cubic
- ease-in cubic
return x * x * x; - ease-out cubic
return 1 - Math.pow(1 - x, 3); - ease-in-out cubic
return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
Quart
- ease-in quart
return x * x * x * x; - ease-out quart
return 1 - Math.pow(1 - x, 4); - ease-in-out quart
return x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2;
