Look at FindColor for details.
function ImFindColor(Pal: PPalette32; Entries: LongInt; Color: TColor32): LongInt; cdecl;
ImagingExport (at line 169)