How Windows 95 Handled 256-Color Palette Shifts

During the mid-1990s, most consumer PC hardware was limited to 8-bit color displays capable of showing only 256 colors simultaneously from a broader hardware spectrum. To balance multitasking with this hardware limitation, Windows 95 relied on the Graphics Device Interface (GDI) Palette Manager. This subsystem prioritized the foreground application’s color palette while forcing background applications to map to those colors, creating a dynamic system of hardware palette swaps that often resulted in visible, instantaneous color distortion across inactive windows.

The 8-Bit Hardware Limit and System Colors

In an 8-bit color environment, the video card relies on a Color Look-Up Table (CLUT) containing 256 entries. Windows 95 reserved 20 of these entries for its own user interface:

  • The 20 Static System Colors: The first 10 slots (indices 0–9) and the last 10 slots (indices 246–255) were reserved for essential operating system elements, including window borders, desktop gray, scrollbars, and standard text colors.
  • The 236 Dynamic Slots: The remaining middle entries (indices 10–245) were freely available to applications to define custom color ranges for images, video, and games.

Foreground Palette Priority

Because only one hardware color table could exist at a time, Windows 95 enforced strict priority based on window focus:

  1. Focus Notification: When a window gained focus, Windows 95 sent it the WM_QUERYNEWPALETTE message.
  2. Realizing the Palette: The foreground application called GDI functions (SelectPalette and RealizePalette). Windows copied the application's requested colors directly into the 236 dynamic hardware palette slots.
  3. Broadcasting Changes: Once the hardware palette was updated, the operating system broadcasted the WM_PALETTECHANGED message to all other open top-level windows, passing the handle of the window that triggered the change.

Background Remapping and Dithering

When background applications received WM_PALETTECHANGED, they were required to adapt to the new color environment without altering the physical hardware palette:

  • Nearest-Color Matching: Background applications re-realized their palettes as background palettes. Windows mapped their desired colors to the closest matching colors currently available in the hardware table (dictated by the active foreground app and the 20 system colors).
  • Color Dithering: If an exact color match was unavailable, GDI used dithering patterns (mixing two or more available colors in a checkered pixel arrangement) to approximate the intended shade.
  • Unresponsive Applications: If a background application failed to process the WM_PALETTECHANGED message, it continued rendering using its old index references. This resulted in the classic "technicolor" corruption, where desktop icons, background windows, and web browsers suddenly appeared in neon pinks, greens, or inverted tones.

Full-Screen Bypasses and DirectDraw

For demanding multimedia software and games, standard GDI palette management was too slow and introduced noticeable frame drops during palette animations.

Developers often used an "Identity Palette," where the application's logical palette was configured to match the hardware layout precisely, eliminating color-translation overhead. Furthermore, the introduction of DirectX and DirectDraw allowed games to bypass the GDI Palette Manager entirely. In exclusive full-screen mode, DirectDraw allowed games to directly overwrite all 256 entries of the hardware Digital-to-Analog Converter (DAC), locking out the desktop and eliminating background palette conflicts until the user minimized or exited the game.