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:
- 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.
- 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:
- Provide an option that enables users to turn off patterned backgrounds in the software. Text drawn over a patterned background will be illegible for many users because it does not provide sufficient contrast between the background and the text, and because the pattern "bleeds" into the text. In order to read the information on the screen, some users need to be able to turn off the background and revert to a solid color background.
- Turn off the background in response to the High Contrast setting.
- Provide sufficient contrast in the default background and text. For example, do not use black text on a gray background. "Effective Color Contrast" (link resides outside of ibm.com) from Lighthouse International provides contrast guidelines.
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.
| Action | Results | |
|---|---|---|
| 1. |
If the software automatically inherits the system settings for high contrast:
|
Pass:
|
| 2. |
If the software provides an option to use the system settings instead of automatically inheriting them:
|
Pass:
|
©2009 IBM Corporation
Last updated October 1, 2009.
