Look at this:
var
palette: array [0..2] of TRGB = ((b: 0; g: 0; r: 0), (b: 12; g: 20; r: 30), (b: 40; g: 60; r: 70));
procedure TForm1.Button22Click(Sender: TObject);
var
RGBToFind: TRGB;
idx: integer;
begin
RGBtoFind := CreateRGB(28, 18, 10); // should match index 1 (b:12, g:20, r:30)
idx := _GetSimilColor(palette, length(palette), RGBtoFind);
ShowMessage(IntToStr(idx));
end;