Keeping 16 bits colors in 256 color mode

Our application has colored panels (Yuck !, I Know, but its our customers
wish),
but has to run not only on 16 bit and higher colors screens, but also at 256
colors.

How can I display the same color in all color modes.
(so how can I keep my color palette for my panels)

Maybe someone allready has a few lib functions, aye ?

greetings

Frank.