const
wdf: array[0..19] of TColor = (
$000000, $000080, $008000, $008080, $800000,
$800080, $808000, $C0C0C0, $C0DCC0, $F0CAA6,
$F0FBFF, $A4A0A0, $808080, $0000FF, $00FF00,
$00FFFF, $FF0000, $FF00FF, $FFFF00, $FFFFFF);
xpf: array[0..30] of TColor = (
$006699, $0099CC, $00CCFF, $00FFFF, $99FFFF, $9DDBFF, $66CCFF,
$3399FF, $4B79FF, $0033FF, $000099, $663333, $993300, $CC6600,
$D78300, $FF9900, $DE9A3E, $FFCC99, $FFE2B4, $FFFFDE, $FFCCFF,
$FFCCCC, $FF9999, $CC6666, $CC9999, $996666, $006600, $009900,
$33CC66, $66FF99, $CCFFCC);
procedure Microangelopalette;
var
x: integer;
btnf: TColor;
ms: TMemoryStream;
s, r, g, b: string;
procedure wrt;
begin
ms.writebuffer(s[1], length(s));
end;
begin
ms := TMemoryStream.create;
s := 'JASC-PAL'#13#10'0100'#13#10'256'#13#10;
wrt;
// --- Windows Standardfarben ---
for x := 0 to 9 do begin
s := inttostr(wdf[x] and $FF) + #32 + inttostr((wdf[x] and $FF00) shr 8)
+ #32 + inttostr((wdf[x] and $FF0000) shr 16) + #13#10;
wrt;
end;
// --- Windows XP Farben 1. Teil ---
for x := 10 to 40 do begin
s := inttostr(xpf[x - 10] and $FF) + #32 + inttostr((xpf[x - 10] and
$FF00) shr 8) + #32 + inttostr((xpf[x - 10] and $FF0000) shr 16) +
#13#10;
wrt;
end;
// --- einmal schwarz ---
s := '0 0 0'#13#10;
wrt;
// --- einmal blau ---
s := '0 0 255'#13#10;
wrt;
// --- einmal grün ---
s := '0 255 0'#13#10;
wrt;
// --- einmal rot ---
s := '255 0 0'#13#10;
wrt;
// --- einmal weiss ---
s := '255 255 255'#13#10;
wrt;
// --- der Rest wird clBtnFace ---
btnf := colortorgb(clBtnFace);
r := inttostr(getrvalue(btnf));
g := inttostr(getgvalue(btnf));
b := inttostr(getbvalue(btnf));
for x := 46 to 245 do begin
s := r + #32 + g + #32 + b + #32#13#10;
wrt;
end;
// --- Windows XP Farben 2. Teil ---
for x := 246 to 255 do begin
s := inttostr(wdf[x - 236] and $FF) + #32 + inttostr((wdf[x - 236] and
$FF00) shr 8) + #32 + inttostr((wdf[x - 236] and $FF0000) shr 16) +
#13#10;
wrt;
end;
ms.savetofile('c:\test.pal');
ms.free;
end;