Skip to main content

Software checklist

Checkpoint 4.3: System settings for high contrast

Support systems settings for high contrast for all user interface controls and client area content.

On this page:

 

Rationale

For most people, color is a matter of preference, but it is critical for many users with visual impairments. Many users with low vision need high contrast between text and the background to be able to read information on the screen. They may even need a particular color scheme, such as white text on a black background, to prevent the background from "bleeding" over and obscuring the foreground text. Some people consider the default color scheme legible but find that it causes eyestrain over longer periods of time.

Some operating systems provide a "high contrast" setting. For example, Windows users enable high contrast by going to the Control Panel and selecting Accessibility Options. On the Display tab, they can select the checkbox to enable high contrast and specify the high contrast settings they want to use. The purpose of this checkpoint is to enable users who need a high contrast color scheme to define their display preferences in one place rather than having to modify the display settings for each application.

Required development techniques

The following techniques are the minimum required to meet Checkpoint 4.3 from the IBM Software Accessibility Checklist:

  1. Software must determine if the user has specified high contrast and ensure use the color scheme specified by the high contrast setting is supported throughout the software.
  2. If system settings are not automatically inherited, provide an option to use the system settings for high contrast instead of the program settings.

Examples for Microsoft Windows developers

1. Software must determine if the user has specified high contrast and ensure use the color scheme specified by the high contrast setting is supported throughout the software.

Example 1

Windows applications should use the SPI_GETHIGHCONTRAST and SPI_SETHIGHCONTRAST flags with the SystemParametersInfo function to get and set the high contrast parameter. The status of the high contrast parameter should be checked during initialization and when processing WM_SYSCOLORCHANGE messages.

The status of the high contrast parameter can be obtained by calling SystemParametersInfo with the SPI_GETHIGHCONTRAST flag. If the dwFlags member of the HIGHCONTRAST structure has the HCF_HIGHCONTRASTON bit set, then the high contrast support is enabled.

Software must then support the high contrast setting by using the colors defined by the user for high contrast, foreground and background pair. This can be obtained by using the GetSysColor function using either the combination of COLOR_WINDOWTEXT and COLOR_WINDOW or a combination of COLOR_BTNTEXT and COLOR_BTNFACE. These combinations will enable software to infer the correct setting.

All information displayed must support the high contrast setting, including all text and images. Images that contain multiple colors should be drawn using the high contrast color combinations, only.

The high contrast parameters (link resides outside of ibm.com) are discussed in more detail on the Microsoft MSDN site. Microsoft also provides examples for enabling high contrast (link resides outside of ibm.com) on their Web site.

The following code sample from the MSAA SDK shows how to check for high contrast:

BOOL fHighContrast = FALSE;
HIGHCONTRAST hc;
hc.cbSize = sizeof( hc );
if( SystemParametersInfo( SPI_GETHIGHCONTRAST, sizeof( hc ), & hc, FALSE ) && ( hc.dwFlags & HCF_HIGHCONTRASTON ) )
fHighContrast = TRUE;


If system settings are not automatically inherited, provide an option to use the system settings for high contrast instead of the program settings. Even if the software provides custom settings for displaying content, it must still provide an way for users to choose the system settings instead of custom settings provided by the program.

2. If system settings are not automatically inherited, provide an option to use the system settings for high contrast instead of the program settings.

Even if the software provides custom settings for displaying content, it must still provide a way for users to choose the system settings instead of custom settings provided by the program.

Examples for Eclipse SWT developers

1. Software must determine if the user has specified high contrast and ensure use the color scheme specified by the high contrast setting is supported throughout the software.

Example 2

Eclipse applications should use the getHighContrast() method to determine whether the user has enabled a high contrast scheme. Use the standard background color in a high contrast theme. The following example sets white as background color if not in a high contrast theme.

Boolean highContrast = Display.getDefault().getHighContrast();
if (highContrast) {
return Display.getCurrent().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND);
}
else {
return Display.getCurrent().getSystemColor(SWT.COLOR.WHITE);
}

Note: High contrast must be set before the Eclipse Platform is launched.

2. If system settings are not automatically inherited, provide an option to use the system settings for high contrast instead of the program settings.

Even if the software provides custom settings for displaying content, it must still provide a way for users to choose the system settings instead of custom settings provided by the program.

Examples for Java developers

See the examples to implement high contrast using Java Swing.

Required test techniques

The techniques above are required; the following techniques are recommended to enhance accessibility:

Required test techniques

Test the software to ensure that it complies with accessibility requirements. Windows is the only platform that currently provides a system setting for high contrast. This checkpoint cannot be verified on other platforms.

Required test software

There are no tools required to test this checkpoint.

Test techniques

The following test techniques are required to verify this checkpoint.

Techniques
Action Results
1.

If the software automatically inherits the system settings for high contrast:
  1. Open the Control Panel - Accessibility Options. On the Display tab, check the option to "Use High Contrast". Select the "Settings" button and select a high contrast scheme such as "White on Black". Select the OK button and then the Apply button.
  2. Switch focus back to the application.
  3. Verify that the software's user interface controls and client area are displayed using the new contrast scheme.
  4. Test at least two high contrast settings to verify the software is not dependent on a particular setting.
Pass: Fail:
2.

If the software provides an option to use the system settings instead of automatically inheriting them:
  1. Enable the application option to inherit system settings for high contrast.
  2. Go to Control Panel - Accessibility Options. On the Display tab, check the option to "Use High Contrast". Select the "Settings" button and select a high contrast scheme such as "White on Black". Select the OK button and then the Apply button.
  3. Switch focus back to the application.
  4. Verify that the software's user interface controls and client area are displayed using the new contrast scheme.
  5. Test at least two high contrast settings to verify the software is not dependent on a particular setting.
Pass: Fail:

©2009 IBM Corporation

Last updated October 1, 2009.