Using Color and Grayscale Palettes

Designers often rely on color to make an application visually pleasing. However, using color randomly or excessively can affect usability. To use color effectively, keep the following guidelines in mind when designing a UI:

The color design model for Windows CE uses a 16-color Windows palette, based on the Windows-based color scheme, and is measured in bits per pixel (bpp). Windows CE supports pixel formats of 1, 2, 4, 8, 16, 24, and 32 bpp. Your application should determine the color format that is supported by a display device, and then adopt a complimentary display strategy.

Note An 8-bpp display driver can display a 32-bpp device-independent bitmap (DIB) by mapping each color in the DIB color table to a specific color on the device. The palette that is available in the application displaying the bitmap determines what mapping is used. The application can lose color information if it does not use an appropriate palette or if a bitmap uses more colors than the palette can hold.

The following illustration shows a standard 16-color palette.

Some Windows CE–based devices support only a 2-bpp palette, with four gray-scale colors: black, white, light gray, and dark gray. On a grayscale display, a single-pixel graphical element, such as a dot or a line, can be difficult to distinguish without an adjacent high contrast color. For example, white and light gray elements can be hard to see unless presented against a black or dark gray background.

Likewise, light colors might be difficult to distinguish. When using light colors, double the thickness of pixels or lines to strengthen them. Light gray works well for creating a shadow effect around large controls on a white background and for anti-aliasing, which adds colored pixels to a graphic to smooth jagged edges. If you use light gray as a background color for your screen, use a white line to visually separate key areas, such a command bar or owner-drawn menu, from other areas of the screen.

Windows CE does not arbitrate between the palettes of the background and foreground applications. Because of this, you should use only the first 10 and last 10 colors included in the stock palette of a display device, which generally are the standard Windows video graphic adapter (VGA) colors.