Audit a Fictional Button Pair with the Contrast Checker
Check text and surface color combinations, interpret the displayed WCAG thresholds, and refine a sample button without confusing one pair for a full audit.
By DevSphere Editorial · · 5 min read
Open Color ToolsWrite down the exact component colors
Contrast problems often arrive as a concrete design question: can a button label be read on its fill? This exercise tests a fictional button with white text #FFFFFF on a medium blue surface #4A90C2. Open Color Tools and choose the Contrast Checker subtool. Enter the foreground as the text color and the background as the button fill. Use the color input or type the complete six-digit hex value. The preview updates to show sample text in the selected pair, giving a quick visual check alongside the numeric ratio.
Keep the evaluation tied to the exact component. A button label, a focus outline, a disabled control, and a large decorative heading may have different colors and requirements. Do not copy a color from a design file without checking whether opacity, gradient, or background imagery is involved. The checker uses two flat hex values and does not sample transparency or compute the effective color of layered elements. First test a simple opaque case, then identify any visual effects that require additional analysis.
Foreground text: #FFFFFF
Button fill: #4A90C2
Component: fictional primary action
Read the levels as specific comparisons
The results panel shows a contrast ratio and separate pass/fail indicators for AA normal, AA large, AAA normal, and AAA large. The displayed thresholds are 4.5:1 for AA normal text, 3:1 for AA large text, 7:1 for AAA normal, and 4.5:1 for AAA large. Match the result to the text's actual size and weight category under the applicable accessibility guidance; do not select a more forgiving category simply because a label appears prominent in a mockup.
A displayed pass means only that the selected foreground and background pair meets that numeric threshold in the tool's calculation. It does not certify the full component, page, or product. The example uses a standard sample preview, not your actual font rendering, icons, borders, focus states, or neighboring content. If the sample fails, adjust a color and retest. Record both values and the use case so reviewers can reproduce the comparison.
Interpret the four indicators against the displayed thresholds:
AA normal: 4.5:1
AA large: 3:1
AAA normal: 7:1
AAA large: 4.5:1
Refine the pair without losing the design intent
If white text on the sample blue does not meet the intended threshold, darken the blue incrementally or test a darker text color. The native color control makes it easy to explore a neighboring shade; the text input accepts a six-digit hex value. Keep the button's intended visual identity in mind, but do not preserve a hue at the cost of readable text. Another option is to use the blue for a border or icon and choose a darker solid fill for the primary action, then retest the new pair.
Use the swap arrow to reverse the foreground and background when exploring whether dark text on a light blue surface is a better fit. The ratio itself is the same when the colors exchange positions, but the perceptual design and application differ. Avoid selecting a color based on its name or monitor appearance alone. The most useful result is a pair that both meets the desired threshold and works in the actual product layout.
Revision workflow:
1. Change one color.
2. Read the updated ratio.
3. Compare the intended AA or AAA target.
4. Review the real button with its actual type size.
Test other states, not just the default
A polished button may have hover, pressed, disabled, focus, and loading appearances. The contrast checker has no state model; enter each state as its own foreground/background pair and keep a small record of the results. For a focus indicator or adjacent border, evaluate the relevant visual requirement separately instead of treating the button label result as sufficient. If the label changes opacity over a surface, calculate or sample the effective color with a suitable design workflow before entering a flat pair.
A common mistake is to check the button fill against the page background while forgetting the label itself. Another is testing a bright accent as body text because it looks strong as a large swatch. Use the checker for the relationship under review and inspect the rendered control at representative sizes. Text anti-aliasing and font weight affect perceived clarity even though the ratio formula remains the same.
Document limitations and verify the final interface
The color tool accepts hex color pairs and calculates contrast using a relative-luminance formula. It does not inspect a live webpage, detect text sizes, identify non-text contrast issues, or assess keyboard use, screen-reader names, focus visibility, error messaging, and color-only meaning. A set of green indicators in this panel is useful evidence for a pair; it is not an accessibility conformance report or certification.
For a dependable review note, identify the exact label color, surface color, text size category, and displayed ratio. Re-run the comparison after each design adjustment rather than carrying a previous pass result forward. If a button has a border, shadow, or gradient, check the relevant states and surfaces separately. A pass for the sample text pair does not establish that the real interactive component has a visible boundary or a usable focus indicator.
After selecting a passing candidate, check the implemented component in its real typeface, browser, layout, and adjacent states. Confirm that status and affordance remain understandable without color alone, and have a person review it if the interface is important. Keep a record of the tested hex values and threshold. If an opaque pair passes but the real design uses transparency or a background image, the pair's result does not transfer automatically.