← Wasteland tools

Contrast Repair

Find the fewest color-token changes that make all your declared foreground and background pairs pass together.

Exhibition labels

Checking contrast

Preparing the project.

Proof a pair

Original

Proposed

Ratios use opaque solid sRGB colors. The unrounded ratio decides whether each requirement passes.

Project editor

Declare each real use and the contrast it must reach.

Take the repair

Load the patch after the original rule in the same cascade layer. The report includes the project, assignment, ratios and search outcome.

Contrast rules, search limits and verification

Choose thresholds for the actual uses in your design. WCAG 2.2 sets a 4.5:1 minimum for normal text and 3:1 for large text at Level AA, with exceptions. Enhanced contrast uses 7:1 for normal text and 4.5:1 for large text. Non-text contrast has its own applicability rules. Minimum text contrast · Enhanced text contrast · Non-text contrast.

Supply the final opaque foreground and background for each use. Transparency, images, gradients, inherited states, typography and context need separate inspection. A passing project covers only the declared pairs. You can create up to 24 tokens, 24 approved swatches and 96 pairs.

Within those specified choices, the solver first minimizes the number of role colors changed. It breaks ties by adding the distances between original and assigned colors in OKLab, each rounded to the nearest hundred-thousandth. A CSS alias can follow a changed source or need an override to retain its starting color, so the exported declaration count can differ. Locks and per-role swatch restrictions narrow the search. A search limit can leave a usable candidate or an unresolved project.

For a second implementation, download the standalone checker beside your exported report and run node check.mjs contrast-report.json. Its work limit can leave a valid assignment without an optimality proof. Refresh or navigation can clear this tab. Save project JSON or a report to resume your work. Apply pending edits before saving.

Edit color role

--

The starting color always remains available. Renaming a role updates its pair rules.

Edit pair rule

Import color roles

Paste one component or theme rule (for example .btn-primary or [data-theme="dark"]), or a list of declarations. Keep direct var(--name) aliases with their source colors. Scope lists, flat classes and basic state selectors are supported. Start a blank project for a separate component or theme. Each project covers one scope. Use opaque three- or six-digit hex colors.

Supported state selectors are :hover, :active, :focus, :focus-visible, :disabled, :enabled and :checked. Check the rendered component in every relevant state. Nested selectors, other cascade layers, fallback values and !important need separate treatment.