Harled
2007-09-26 08:10:29
Flashes colors.. :garfield:
// Flashes colors. i tested canvases and this is the result.
// credit to GoF i guess.
PROGRAM Flashy;
const
Interval = 10; // Interval in ms?
Loops = 10; // Times to loop.
Ch = 250; // Canvas height?
Cw = 250; // Canvas width?
var
CCol, Back: Integer;
const ColNum = 15;
procedure FlashIt(IV, LoopCount: Integer);
var
Sex, Sey: Integer;
begin
for Sex := 0 to LoopCount do
for Sey := 1 to ColNum do
begin
case Random(Sey) + 1 of // random colors from scar
1: CCol:= clAqua;
2: CCol:= clNicePurple;
3: CCol:= clBronzeII;
4: CCol:= clBrightGold;
5: CCol:= clDarkPurple;
6: CCol:= clCream;
7: CCol:= clWhite;
8: CCol:= clBlueViolet;
9: CCol:= clDarkTurquoise;
10: CCol:= clGreen;
11: CCol:= clMaroon;
12: CCol:= clNavy;
13: CCol:= clRed;
14: CCol:= clYellow;
15: CCol:= clMediumVioletRed;
end;
FastDrawClear(Back, CCol);
SafeDrawBitmap(Back, GetDebugCanvas, 0, 0);
Wait(IV);
end;
end;
begin
GetApplication.Title := 'Flashy';
ClearDebug;
Writeln('Flashy by Harled!');
Wait(2000);
DisplayDebugImgWindow(Cw, Ch);
Back := BitmapFromString(Cw, Ch, '');
Writeln('Time to flash!');
FlashIt(Interval, Loops);
RaiseException(erException, 'Script ends here');
end.