var
r1: single = 1;
r2: single = 10;
n: integer = 8;
x, y: integer;
col1,col2,col,steps: integer;
procedure TForm1.FormPaint(Sender: TObject);
var k: Integer;
begin
Canvas.Brush.Color := Color;
Canvas.FillRect(ClientRect);
for k := 0
to n
do
begin
Canvas.Pen.Color :=
rgb(col,col,col);
Canvas.Brush.Color :=
rgb(col,col,col);
x := round( cos(k * 2 * Pi / n) * (r1 - r2) );
y := round( sin(k * 2 * Pi / n) * (r1 - r2) );
Canvas.Ellipse(200+x-3,200+y-3,200+x+3,200+y+3);
col := col - steps;
if col >= col2
then col := col1;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
invalidate;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
doublebuffered := true;
col1 := getrvalue(clgray);
col2 := getrvalue(clsilver);
steps:= round((col1 - col2) / n);
col := col1;
end;