Found in the depths of old code archives.
Simba Code:
function ShowPalette (colors :TintegerArray ; w,h,MaxInRow :integer ;Frame :Boolean ;FrameColor :integer ) : integer;
var
col,a,hig: integer;
box :Tbox;
begin
hig := Length(colors);
if ( hig > MaxInRow ) then
begin
col := MaxInRow;
Result := CreateBitmap(col*w+1,h+((hig-1) div col)*h+1);
end else begin
col := hig;
Result := CreateBitmap(col*w+1,h+1);
end;
for a:=0 to hig-1 do
begin
box := IntToBox ( w*(a mod col) , (a div col)*h , w+w*(a mod col) , h+(a div col)*h);
RectangleBitmap(Result,box,colors[a]);
if(Frame) then DrawTPABitmap(Result,EdgeFromBox(box),Framecolor);
end;
GetBitmapSize(Result,w,h);
DisplayDebugImgWindow(w,h);
DrawBitmapDebugImg(Result);
end;
Example:
Simba Code:
procedure TIntegerArray.Add(int:integer);
begin
setLength(self,Length(self)+1);
self[high(self)] := int;
end;
var bmp,i:integer;
var tia :tintegerarray;
begin
for i := 0 to 255 do
tia.Add(RGBtoColor(127+(i div 2),i,255-i));
ShowPalette(tia,30,30,20,true,$0000FF);
end.
Simba Code:
procedure TIntegerArray.Add(int:integer);
begin
setLength(self,Length(self)+1);
self[high(self)] := int;
end;
var bmp,i:integer;
var tia :tintegerarray;
begin
for i := 0 to 255 do
tia.Add(RGBtoColor(33,i,33));
ShowPalette(tia,40,40,20,false,0);
end.
Simba Code:
procedure TIntegerArray.Add(int:integer);
begin
setLength(self,Length(self)+1);
self[high(self)] := int;
end;
var bmp,i,j:integer;
var tia :tintegerarray;
begin
for i := 1 to 360 do
for j := 0 to 1000 do
begin
tia.Add(HSLToColor(i,cos(radians(i))*100,j/10));
end;
ShowPalette(tia,1,1,1000,false,0);
end.