FMXTFmxObjectAnimateColor (Delphi)
Contents
Description
This example shows how to call the TFmxObject method AnimateColor. Note that once called, you do not have access to the TColorAnimation instance that AnimateColor creates.
This instance has Rectangle1 as its parent, therefore it will be cleaned up when Rectangle1 is deleted. This example requires a TRectangle in a TForm.
Note that if you misspell 'Fill.Color', AnimateColor does nothing.
Code
procedure TForm1.TurnBlueClick(Sender: TObject);
begin
Rectangle1.AnimateColor('Fill.Color', $FF0003F3, 5, TAnimationType.InOut,
TInterpolationType.Linear);
end;
procedure TForm1.TurnRedClick(Sender: TObject);
begin
Rectangle1.AnimateColor('Fill.Color', $FFF32000, 5, TAnimationType.InOut,
TInterpolationType.Exponential);
end;
Uses
- FMX.Types.TFmxObject.AnimateColor ( fr | de | ja )
- FMX.Ani.TColorAnimation ( fr | de | ja )
- System.UITypes.TAlphaColor ( fr | de | ja )
- FMX.Types.TAnimationType ( fr | de | ja )
- FMX.Types.TInterpolationType ( fr | de | ja )