uses graph, crt;
var a,b,c,d:integer;
procedure konec1;
begin
readkey;
for c:=42 downto 0 do begin
    setrgbpalette (5,2,2,c);
    setrgbpalette (3,round (c*1.3),round (c*1.3),round (c*1.3));
end;
closegraph;
clrscr;
halt;
end;
procedure konec2;
begin
readkey;
for c:=42 downto 0 do begin
    setrgbpalette (4,2,2,c);
    setrgbpalette (3,round (c*1.3),round (c*1.3),round (c*1.3));
end;
closegraph;
clrscr;
halt;
end;
begin
initgraph (a,b,'system');
setrgbpalette (3,0,0,0);
setrgbpalette (5,0,0,0);
setrgbpalette (4,0,0,0);
setcolor (5);
for d:=0 to 479 do line (0,d,639,d);
setcolor (0);
line (0,479,639,0);
line (0,0,639,479);
setfillstyle (1,4);
floodfill (500,300,0);
floodfill (0,300,0);
rectangle (110,110,639-110,479-110);
floodfill (320,200,0);
floodfill (320,300,0);
setfillstyle (1,5);
floodfill (400,240,0);
floodfill (200,300,0);

setcolor (3);
settextstyle (7,0,10);
outtextxy (75,100,'AlPaint');
settextstyle (2,0,7);
outtextxy (225,250,'   verze 2.0    ');
for c:=1 to 43 do begin
    b:=round ((63/43)*c);
    setrgbpalette (4,2,2,c);
    setrgbpalette (3,b,b,b);
    end;
outtextxy (225,280,'Graficky Program');
while keypressed do readkey;
repeat
    for c:=0 to 43 do begin
    setrgbpalette (5,2,2,c);
    setrgbpalette (4,2,2,43-c);
    end;
    if keypressed then konec1;
    for c:=42 downto 0 do begin
    setrgbpalette (5,2,2,c);
    setrgbpalette (4,2,2,43-c);
    end;
    outtextxy (80,320,'Program, Design A Grafika : Pavel Kopecky');
    if keypressed then konec2;
until b=17;
end.
