gdi32: Add a helper for RGB to color index mapping to avoid redundant shifts.