procedure SendEscapeSeq(const S: String);
begin
fpWrite(stdoutputhandle, S[1], Length(S));
end;
function HexChar(A:Byte):Char;
begin
A:=A and 15;
if A<10 then HexChar:=Char(Ord('0')+A) else HexChar:=Char(Ord('A')+A-10);
end;
function Hex2(A:Byte):Str2;
begin
Hex2:=HexChar(A shr 4)+HexChar(A)
end;
const
{ palette slot }
SL : VGASlot = (0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63);
VGA_Default : vga_pal = (
{ red } (0,0,0,0,42,42,42,42,21,21,21,21,63,63,63,63),
{ green } (0,0,42,42,0,0,21,42,21,21,63,63,21,21,63,63),
{ blue } (0,42,0,42,0,42,0,42,21,63,21,63,21,63,21,63));
procedure Set_palette(Slot:Word; SR,SG,SB:Byte);
var
B:Byte;
begin
for B:=0 to 15 do
if SL[B]=Slot then
begin
{$IFDEF HAIKU}
//SendEscapeSeq(#27']P'+HexChar(B)+Hex2(SR)+Hex2(SG)+Hex2(SB));
//SendEscapeSeq(#27']1337;SetColors='+HexChar(B)+Hex2(SR)+Hex2(SG)+Hex2(SB)+#26'\');
//SendEscapeSeq(#27']P4;'+Hex2(B)+';#'+Hex2(SR)+Hex2(SG)+Hex2(SB)+#7);
{$ENDIF}
Break
end;