I asked a question about this, didn't get any answers, and finally did some hacking around until I figured it out on my own. Here's a routine to get a specific color from a palette referenced by a HPALETTE handle. (I know BMPs and PNGs use this method. Not sure what other graphics formats do.)
I wrote this routine for a PNG object, but it will work for BMPs or any other graphics file type with a property named "palette" of type HPALETTE, simply by modifying the data type in the function header.
function getPaletteColor(const image:TPngObject; const color: byte): TColor;
theColor: array[0..0] of TPaletteEntry;
GetPaletteEntries(image.Palette, 0, 1, theColor);
result := theColor.peRed;
inc(result, (theColor.peGreen * $100));
inc(result, (theColor.peBlue * $10000));
Feel free to use this in your projects.