Accessible Palette Builder
Loading tool controls…
Accessible Palette Builder At a Glance
An accessible palette builder makes color selection more systematic by calculating how strongly candidate colors contrast with a particular background. Start with a brand or interface color, choose a background, and specify a ratio of 3:1, 4.5:1, or 7:1. The tool creates nearby lighter and darker alternatives and shows only those that satisfy the selected threshold. This is especially useful when a preferred brand shade looks attractive but is difficult to read in body text. A contrast-compliant swatch can be a useful starting point, but color contrast alone does not establish that an entire website or document is accessible.
How the Accessible Palette Builder Works
Enter the starting HEX color in the first field and the intended background color in the second. Colors may use three- or six-digit hexadecimal notation, such as #6750A4 or #FFF. Choose the contrast goal that matches the text or component being designed. Select Generate contrast-aware palette to see alternative shades and their calculated ratios. Each displayed swatch shows its HEX value and the contrast ratio against your selected background. Clicking a swatch copies that color for use in CSS or a design application, and the text report can be downloaded when you need to document the choice.
The generator does not randomly invent a full brand palette. It searches along interpolations between the starting shade and black or white, then ranks qualifying candidates by their RGB distance from the original. This approach favors simple changes that preserve some visual connection to the seed color. It does not guarantee identical hue perception or even spacing between colors, and it does not optimize for every display technology. Review the swatches together rather than assuming that the numerically nearest eligible shade is automatically the most attractive or most readable choice in your layout.
Why Contrast Depends on Two Colors
A color cannot be classified as sufficiently contrasting without identifying the background against which it will appear. The same medium purple that works well as a heading on white may be difficult to read on a dark violet card. Similarly, a pale accent used as a large decorative shape may not work as text on a pale surface. The relevant quantity is the relationship between foreground and background luminance. Changing either side can improve that relationship, which is why entering an accurate background color is essential. A single brand HEX value does not have a universal accessibility score.
The color contrast checker evaluates an individual foreground-and-background pair and displays the common WCAG text and non-text thresholds. Use the palette builder when you need alternatives and the contrast checker when verifying a specific final pair. If your design contains cards, navigation bars, disabled controls, banners, and dark-mode surfaces, assess each pairing separately. A color that passes on the main page background may fail in a small badge or inside a translucent overlay where the effective background is different.
Understanding the 3:1, 4.5:1, and 7:1 Goals
For WCAG 2.x contrast calculations, ordinary text at Level AA generally requires at least 4.5:1 against its background. Large text has a lower AA threshold of 3:1. Certain non-text interface elements and graphical objects also use a 3:1 threshold when their appearance is necessary to identify or understand them. Level AAA uses stronger text goals, including 7:1 for normal text and 4.5:1 for large text. These thresholds serve distinct purposes. Selecting 3:1 in the palette builder does not mean the result is sufficient for normal-sized body text.
Text size and weight matter when deciding whether the large-text exception applies. A headline that looks visually prominent to its designer may not meet the technical size and weight definitions that qualify it for the lower ratio. For ordinary article paragraphs, choosing a 4.5:1 target or greater is the safer starting point. Important warnings, transactional errors, and dense tables may benefit from stronger contrast and clear supporting cues. Even a ratio above 7:1 does not excuse tiny text, cramped line spacing, or difficult typefaces that make reading uncomfortable.
Choosing a Brand Color That Still Works for Text
Brand palettes are often selected for their character and recognition before practical interface requirements are considered. A light pastel may look excellent in an illustration yet provide insufficient contrast for links or buttons on white. Rather than abandoning the brand color, separate its uses. Keep the original shade for large surfaces, decorative accents, or illustrations where appropriate, and select a deeper related shade for small labels and body text. This lets the identity remain recognizable while giving essential content a reliable text color. The best color system often contains functional variations rather than one universal accent.
Think about hover and focus states before applying a new palette. A purple link that passes contrast in its normal state may become too pale on hover, particularly if the hover rule adds transparency. Selected tabs, active navigation, and error indicators also need states that remain understandable. Use more than color alone to indicate required or changing information: add labels, underlines, icons with text, or other meaningful distinctions. A color vision preview can illustrate how some color differences may become less pronounced, though its transformations are approximations rather than a substitute for user testing.
Working with White, Dark, and Colored Backgrounds
White is a convenient background for checking brand text colors, but many interfaces contain cards with off-white, gray, blue, or purple surfaces. Enter the actual background HEX value instead of approximating it as white. On a dark surface, a much lighter version of the accent may be necessary. A component may also change background between default, focused, hovered, and pressed states, requiring separate contrast checks. If your design system uses transparent layers, calculate the final composited color before checking; the current palette builder evaluates solid HEX colors rather than performing alpha compositing.
Dark mode requires more than inverting light-mode colors. Very bright text on black can feel harsh for long passages, while some muted accents disappear against charcoal. Select backgrounds and foregrounds as real pairs, then examine hierarchy, spacing, and reading comfort. In diagrams and dashboards, color may encode meaning across a series, so sufficient text contrast does not ensure the plotted series are distinguishable. Use shapes, patterns, line styles, and direct labels to communicate categories without relying entirely on color. Accessibility is a property of the whole interaction, not a feature of one color swatch.
Applying Candidate Colors in CSS
After selecting an eligible swatch, put it into a named CSS variable that describes the component role, such as a text accent or button foreground, rather than replacing every occurrence of the original brand color. This gives you flexibility to change functional colors without unintentionally altering decorative surfaces. Evaluate the new token wherever it appears: paragraph links, focus rings, button labels, navigation items, and smaller helper text. The same HEX value may be paired with different backgrounds, which means one globally shared token is not automatically appropriate for every component.
Documenting color roles can simplify future maintenance. A design system may include a main text color, a subdued-but-readable secondary text color, a border color, and specific accents for feedback states. These roles should be tested in their actual contexts. A successful palette is not simply a row of attractive squares; it is a set of choices that remain understandable across devices and states. Review responsive typography as well, because a heading may drop to body-like dimensions on mobile and no longer qualify for a lower contrast threshold.
Limits of Automated Palette Suggestions
The generator tests solid foreground colors against one solid background using the familiar WCAG 2.x relative-luminance method. It does not evaluate gradients, photographs, opacity, font rendering, animation, or variable user display settings. Two colors may technically reach a chosen threshold yet still look too similar in a particular texture or become difficult to tell apart at small sizes. There is also more to digital accessibility than this single method; newer contrast models and user research may raise different considerations. Treat these numerical findings as one input into a broader design review.
When selecting colors for important public services, payment forms, dashboards, or accessible documents, confirm that meaning survives grayscale printing and color-vision differences, and test with real assistive technologies. Examine keyboard focus visibility, labels, error messages, font size, zoom behavior, and document reading order. A button with excellent contrast can still be inaccessible if its purpose is unclear or it cannot receive keyboard focus. Good palette decisions support readability, but they do not replace testing the interface itself.
Frequently Asked Questions About Accessible Color Palettes
Does a palette that passes 4.5:1 meet all accessibility requirements?
No. A 4.5:1 contrast ratio is a common WCAG 2.x AA requirement for ordinary text, not a complete accessibility certificate. The page may still have unreadable typography, missing labels, inaccessible controls, or essential information conveyed only by color. Check each component and state in context rather than treating one passing number as proof of compliance.
Why does the tool suggest a darker or lighter version of my color?
Changing the brightness of a foreground can create a stronger luminance difference against the chosen background. The tool searches variations toward black and white and keeps candidates that reach the selected target. The closest qualifying result is not necessarily the best visual choice for every component, so inspect several swatches and your actual design before committing.
Can I use the generated colors for button backgrounds?
Yes, but the intended text color must be checked against the button background, not only against the page background. The current tool treats a generated swatch as the foreground compared with the background you entered. For a filled button, enter the button fill as the background and test white or another intended text color as the foreground. Check focus and disabled appearances separately.
What is the difference between a 3:1 and a 4.5:1 goal?
The 3:1 threshold applies to qualifying large text and certain non-text elements at WCAG AA. Ordinary text generally uses 4.5:1 at AA. The correct target depends on size, weight, and the kind of information being conveyed. If you are uncertain about body text, choose 4.5:1 or a stronger goal rather than relying on the large-text exception.
Can I use a single color palette for both light and dark mode?
The same palette may provide acceptable results in both modes only after each color pairing has been checked on its actual background. Usually some roles need separate light- and dark-mode values. Soft accents that read well on dark charcoal may be too light on white, and the reverse can also happen. Test the final states rather than assuming an inversion will preserve contrast.
Does this tool account for transparent overlays?
No. It works with solid three- or six-digit HEX colors. Transparent layers can change the effective color depending on the image or surface underneath. For a transparent component, determine the actual blended foreground and background colors at representative points before evaluating their contrast. Background photographs may require an overlay or a solid text container for reliable legibility.
Why aren't all proposed shades equally spaced?
The candidate shades are generated using simple color interpolation and ranked for closeness to the selected color after contrast filtering. This is not a perceptually uniform color scale, and equal numeric RGB changes do not always appear equally spaced to the eye. Use the tool to find practical eligible pairs, then refine the final visual rhythm within your design system.