
The Clutter::Alpha class binds together a Clutter::Timeline and a function. At each frame of the timeline, the Alpha object will call the given function, which will receive the value of the frame and must return a value between 0 and Clutter::Alpha::MAX_ALPHA.
This is an example of a simple alpha function that increments linearly:
sub linear {
my $alpha = shift;
my $timeline = $alpha->get_timeline();
return int($timeline->get_progress() * Clutter::Alpha->MAX_ALPHA);
}
Alphas are used by Clutter::Behaviours to create implicit animations. By changing the alpha function inside a Clutter::Alpha object it's possible to change the speed of the animation.
Clutter provides some common alpha function, like ramps, sines, smoothsteps, exponential and square waves.