Reference for the Mosaic class Effects::ColorEffect
Using the Pulse color Effect to interpolate between two color key values and animate a property with data type 'color'.
The class Effects::ColorEffect provides an animation effect intended to animate a 'color' value within a range determined by the properties Value1 and value2. During the animation the value is interpolated and stored in the variable Value. Additionally the Outlet property can refer to a 'color' property which thus will be 'remote controlled' by the effect.
Beside the both end values, animation effects are determined by their duration and by the timing function. The duration is primarily controlled by the value of the property CycleDuration. This is the time the effect will take for a single animation run. Whether and how often the animation is repeated is stored in the property NoOfCycles. In this case the property InterCycleDelay can determine an optional interval to wait between two consecutive animation runs. Finally the property InitialDelay determines the interval to wait at the very beginning of the effect still before the first animation run began.
The timing function determines the curve to run the animation. The class implements an extensive set of various timing functions. In its simplest case the animation can follow a straight line, or it can start slow and get faster afterwards. More complex timings perform realistic spring elastic and bounce animations. Besides it the user can configure his/her own animation curve. In such case the timing function is based on a cubic Bezier curve. It gives the designer a lot of possibilities to specify very fancy timing functions. The timing is controlled by the property Timing. In the case the designer wants to specify a new curve, the properties TimingCustom1 and TimingCustom2 are available. With the property Noise an additional random noise can be added to the effect.
During the runtime of the animation, the effect will send signals to the slot method stored in the property OnAnimate. When the effect is finished a signal is send to the slot method stored in the OnFinished property.
Whether the effect is running or not is controlled by its property Enabled. It can be used to start and stop the effect. The effect can also be controlled by sending signals to its StartEffect and StopEffect slot methods. With the property Reversed the playback direction can be determined. This allows to simply rewind running effects or to configure an effect to be played in the reverse direction. The slot method ReverseEffect can also be used to switch the playback direction.
property ^color Outlet = null;
The property 'Outlet' can store a reference to a 'color' property to modify at the runtime of the animation effect. To obtain a reference to a property, the Chora ^ Reference property operator should be used. See 'Chora User Manual'.
var color Value;
The variable 'Value' stores the actual value interpolated by the running animation.
property color Value1 = #00000000;
The property 'Value1' determines the start value for the animation.
property color Value2 = #FFFFFFFF;
The property 'Value2' determines the end value for the animation.