Quote:
Originally Posted by audiofeel
@BLACKFIRE69
Show an example of how to change the color of objects on the fly, as in the example below? FReactangle(FillColor.Stroke.Color). I can't do it with FColorbox.I can't do it. The color changes if you only touch the object.
Code:
var
UIColour: array of TAlphaColor = [$B93A4955, $FF202B2F, $FFC0233C];
procedure TForm1.ComboColorBox1Change(Sender: TObject);
var
I, J: Integer;
begin
if ComboColorBox1 = Sender then
J := 0;
if ComboColorBox2 = Sender then
J := 1;
if ComboColorBox3 = Sender then
J := 2;
for I := 0 to ComponentCount - 1 do
begin
if (Components[I] is TShape) then
begin
if TShape(Components[I]).TagString = J.ToString then
TShape(Components[I]).Fill.Color := TComboColorBox(Sender).Color;
if TShape(Components[I]).TagString = (J + Length(UIColour)).ToString then
TShape(Components[I]).Stroke.Color := TComboColorBox(Sender).Color;
end;
UIColour[J] := TComboColorBox(Sender).Color;
end;
end;
|
see this, change the color of objects on the fly.
Code:
FMXColorAnimation[1].StopAtCurrent;
FMXColorAnimation[1].SetColors(FMXComboColorBox[2].GetColor, FMXComboColorBox[1].GetColor);
FMXColorAnimation[1].Start;
Code:
FMXArc[2].StrokeColor(FMXComboColorBox[3].GetColor);
FMXCircle[5].StrokeColor(FMXComboColorBox[3].GetColor);
FMXRectangle[87].FillColor(FMXComboColorBox[3].GetColor);