ULONG rgb = hw_GetRGB(ULONG color, int infmt);
To convert a color from RGB to an arbitrary pixel format, use hw_MapRGB(). See hw_MapRGB for details.