Use the Contrast testing tool in the browser extension to test color contrast for text and interface elements. You can test contrast outside of manual evaluations or directly within a manual evaluation workflow.
On this page:
- Access Contrast testing
- Test contrast by selecting an element
- Adjust sampled pixels
- Test contrast by picking colors
- Open the Contrast testing tool inside manual evaluations
Access Contrast testing
To open the Contrast testing tool outside of a manual evaluation:
- Open the browser extension.
- From the main window, select Contrast testing tool.
You can now choose between Test element mode and Pick colors mode.
Test contrast by selecting an element
Use Test element mode to test the contrast of an element directly on the page.
To test contrast by selecting an element:
- Open the Contrast testing tool.
- Click Select element.
- Select the element you want to test on the page.
- Select Test contrast.
- Review the detected foreground and background colors.
- If needed, adjust the sampled pixels to improve accuracy.
You can also select an element through Chrome DevTools by selecting a node in the DOM.
The extension uses machine learning to identify the dominant colors within the selected element and calculate the contrast ratio.
After the test completes, the extension displays:
- The detected colors.
- The contrast ratio.
- The applicable criteria.
- Whether each criterion passes or fails.
Adjust sampled pixels
If the extension does not detect the correct colors, you can adjust the sampled pixels manually.
To adjust sampled pixels:
- Click Edit sample.
- Focus the selected pixel.
- Use the keyboard to move the selected pixel.
Use the following keyboard controls:
- Press an arrow key to move the selected pixel by 1 pixel.
- Press Shift + arrow key to move the selected pixel by 10 pixels.
- Press Enter or Spacebar to open or close the zoomed view.
You can also select the pixels by clicking and dragging/dropping the color dot.
Test contrast by picking colors
Use Pick colors mode to test contrast between any two colors on the screen.
To test contrast by picking colors:
- Open the Contrast testing tool.
- Select Pick colors.
- Select the foreground color anywhere on the screen.
- Select the background color anywhere on the screen.
- Select Test contrast.
After the test completes, the extension displays:
- The selected colors
- The contrast ratio
- The applicable criteria
- Whether each criterion passes or fails
Open the Contrast testing tool inside manual evaluations
Inside manual evaluations, the workflow for Test element mode and Pick colors mode is the same.
To use the Contrast testing tool inside a manual evaluation:
- Open the manual evaluation.
- Open the Contrast testing tool.
- Choose either Test element or Pick colors.
- Complete the contrast test.
After the results are calculated, the extension displays the results inside the browser extension window and as an overlay on top of the tested page.
Add a finding from contrast test results
After you complete a contrast test inside a manual evaluation, you can create a finding directly from the test results.
To add a finding:
- Complete a contrast test.
- Select Add finding.
- Review the suggested manual rules related to contrast.
- Select the rule you want to use.
You can also search for another rule by ID or rule name.
After you select a rule:
- The extension automatically adds the contrast test results to the Actual results field
- The extension captures a screenshot automatically
- The screenshot includes the contrast results overlay
- The offending element is highlighted in the screenshot
Comments
0 comments
Article is closed for comments.