Complementary color scheme for UI: how to use opposites without the clash
What a complementary color scheme is, why it fails at equal weight, and the 80/20 rule, contrast checks, and dark-mode adjustments that make it work in a real interface.
Summary
A complementary color scheme pairs a hue with the one directly opposite it on the color wheel. It is the highest-contrast scheme there is, which makes it the best way to make one thing on a screen impossible to miss and the fastest way to make a whole screen unpleasant to look at. The difference is weight. This guide covers the color theory in one section, then spends the rest on the part that matters for interfaces: how much of each color to use, where to put it, how to check contrast, and what changes in dark mode. The palette generator builds a complementary scheme from any seed color if you want to follow along.
- Complementary means opposite hues, roughly 180° apart on the wheel.
- In UI, use the pair unevenly — one color carries the interface, the other carries the emphasis.
- Never set complementary colors as text on each other; they vibrate and fail contrast.
- Split-complementary is what most products actually want.
What is a complementary color scheme?
On the standard color wheel, complementary colors sit opposite one another: blue and orange, red and green, violet and yellow. Mix two complements as paint and they cancel toward gray; put them next to each other and each looks more saturated than it is alone. That second effect — simultaneous contrast — is the whole reason the scheme exists. A complement is the color that makes your primary look most like itself.
Two clarifications save a lot of confusion.
First, "opposite" depends on the wheel. The traditional artists' wheel (red, yellow, blue primaries) puts orange opposite blue. The RGB wheel that CSS and every color picker use puts yellow opposite blue, and orange opposite azure. Design tools work in the RGB or HSL space, so when a generator says complementary it means a 180° hue rotation in HSL. That is what the palette generator does too.
Second, a complementary pair is not yet a palette. Two hues give you a brand color and an accent. An interface also needs a background, a surface, a text color, a muted tone and a border, and none of those should be a third hue. They should be near-neutrals tinted toward the primary, so that the complement stays the only "other" color on the page. The semantic palette guide covers those eight roles in detail; the short version is that a complementary UI palette is two hues and six grays that lean toward the first one.
Why complementary schemes fail in interfaces
Complementary schemes are everywhere in sports branding and movie posters, and rare in good software. The reason is that posters are looked at and interfaces are looked through.
When two complements are used at equal weight — a blue sidebar beside an orange content area, say — the eye has nowhere to rest. Every edge between them is the highest-contrast edge on the screen, so every edge demands attention, and the actual content (which is neither color) reads as background. Simultaneous contrast makes both colors appear more saturated than they are, so a palette that looked balanced as swatches looks loud as a layout.
The second failure is text. Orange text on a blue button is a classic mistake: the hues are maximally different, but their lightness is often similar, and contrast for reading is a lightness question. Complementary pairs frequently fail WCAG's 4.5:1 ratio while looking "high contrast" — the hue difference fools the designer, not the reader. Colored fringing along the letter edges (chromatic aberration in the eye) makes it worse.
The third failure is quieter. Interfaces need more than two states: default, hover, selected, disabled, error, success. A pure complementary pair offers no room for those. If orange is your accent, what is your warning color? If green is the complement of your red brand, success and brand collide.
None of this means avoiding complementary schemes. It means using them the way they work.
The 80/20 rule: one color carries, the other points
The fix for almost every complementary failure is to break the symmetry. Pick which hue is the primary — the one that appears on buttons, links, focus rings, active navigation, the chart's first series — and demote the complement to an accent that appears in a handful of places.
A useful ratio is roughly 80/20 by area among the colored elements, with the neutrals making up most of the screen anyway. In practice:
- Primary takes the main call to action, links, selected tabs, progress, and the first chart series.
- The complement takes one thing per screen: a promotional badge, a "new" indicator, the single most important number, the one destructive or attention action.
- Neutrals tinted toward the primary take everything else — backgrounds, cards, borders, body text.
When the complement is scarce it does what simultaneous contrast promises: it glows against a page that is otherwise all one hue family, and the eye goes straight to it. When it is abundant it just makes the page tiring.
The palette generator encodes this ratio in its role assignment. The seed color becomes primary; the complement (180° away) becomes secondary, a supporting role; and the accent is pushed a further 30° to 210° so the two "other" colors are related to each other rather than two independent fights with the primary. The neutrals take the seed's hue at low saturation. Swap the roles if your brand color is the one that should be scarce — the tool lets you rotate the brand assignment — but keep the weight uneven.
Choosing which color is the primary
If the brand is already decided, the brand color is the primary and the complement is the accent. If you are choosing from scratch, three tests help.
Which one reads as a surface? Cooler and darker hues (blues, teals, deep violets) sit comfortably behind content; warm saturated hues (orange, yellow, hot pink) read as objects that want to be small. This is why blue/orange interfaces almost always make blue the primary — an orange interface with blue accents feels like a warning label.
Which one has room for states? The primary needs a hover shade, a pressed shade, a disabled tint and a focus ring, all recognizably the same color. Hues with a wide usable lightness range — blue, teal, violet, green — handle that. Yellow does not: darken it and it turns brown, lighten it and it disappears against white.
Which one has a semantic collision? If the complement of your candidate primary is red or green, it will fight with error and success states. A blue primary with an orange accent leaves red and green free for status. A red primary with a green accent does not — either move the primary a little (a coral or crimson has a teal complement, which is safer) or accept that your status colors need a different treatment.
Making the pair work: saturation and lightness
A complementary scheme is a hue relationship. Saturation and lightness are where you tune how loud it is, and they are the controls a generator's 180° rotation does not decide for you.
Desaturate one side. The classic trick: keep the primary fairly saturated and pull the complement toward gray — a muted terracotta beside a clear blue, a dusty gold beside a deep violet. The pair still reads as complementary, but the accent no longer vibrates. Many "sophisticated" palettes are just a complementary pair with one side at 40% saturation.
Separate the lightness. If the primary is mid-dark (a 40% lightness blue), make the accent noticeably lighter or darker rather than matching it. Two colors that differ in hue and lightness stay distinguishable in grayscale, which is also the test for color-blind accessibility.
Never stack them as foreground and background. Orange text on blue, blue text on orange, an orange icon on a blue button — avoid all of it, regardless of what a contrast checker says about the ratio. Put the complement on a neutral (white, near-black, or a tinted surface) and put white or near-black text on the complement.
The theme generator derives primary-foreground and accent-foreground for exactly this reason: the text on a colored fill is always the background or text neutral, never the other brand color.
Complementary vs split-complementary vs triadic
Three schemes get confused with each other, and the difference matters for interfaces.
| Scheme | Hues | Contrast | Best UI use |
|---|---|---|---|
| Complementary | Seed + 180° | Highest | One dominant color, one scarce accent |
| Split-complementary | Seed + 150° + 210° | High, less tension | A primary plus two related accents (e.g. secondary and highlight) |
| Triadic | Seed + 120° + 240° | Balanced, vivid | Three equal signals — chart series, categories, status |
Split-complementary is the one most products should try first. It keeps most of the contrast of a true complement but replaces the single opposite with its two neighbors, so the accents are related to each other and the pair stops vibrating. It also gives you two accent roles, which is what a real interface needs: a secondary action color and a highlight. The palette generator has a rule for it; compare the swatches against the complementary row and the difference is immediate.
Triadic is the data-visualization scheme. Three hues 120° apart stay distinguishable for most forms of color-vision deficiency and read as three genuinely different categories, which is what a chart legend needs. It is a poor scheme for a marketing page, where three equal colors cancel each other's emphasis.
Checking the scheme before you ship it
Three checks catch nearly every complementary-scheme problem, and all three take under a minute.
Contrast ratios on every text pairing. Body text must reach 4.5:1 against its background and large text 3:1 (WCAG AA). Check the text neutral against the page background and against the card surface, and check white or dark text against both the primary and the accent fills. Every colored button needs a passing foreground. The palette generator's neutral roles are placed at lightness steps chosen to pass these thresholds against each other; the brand roles you add still need checking against whatever text sits on them.
Grayscale. Screenshot the screen and desaturate it. If the primary and the accent become the same gray, they differ only in hue, and anyone with a color-vision deficiency — around 8% of men — sees them as the same. Push the lightness apart until they separate.
The squint test. Step back or squint until detail disappears. The complement should appear as a few small bright points on a field of one hue family. If it appears as a large region, the ratio is wrong.
Complementary schemes in dark mode
Dark mode changes the arithmetic. On a near-black background, a saturated primary that was a fill in light mode becomes a light source: it glows, and its complement glows harder. Two things help.
Lift the lightness, hold the hue. A mid-lightness blue that read as solid on white needs to move to 60–70% lightness to read on near-black at 4.5:1. The accent needs the same lift. Do not compensate by dropping saturation to nothing — a dark UI whose only colors are pastel reads as washed out. The theme generator's derived .dark block does this: it moves lightness for each role, holds hue and saturation, then measures every pair and repairs it until it passes.
Reduce the accent's area further. Bright colors on dark backgrounds occupy more visual weight than the same colors on light backgrounds, so an accent that was 20% in light mode may want to be 10% in dark. A badge and a single button is usually enough.
Because every dark-mode value is derived from the light role rather than chosen independently, the complementary relationship survives the switch — the hues do not move, only their lightness — which is the property that keeps a scheme recognizable as the same brand in both modes.
A worked example
Take a seed of #4f46e5, the indigo the palette generator opens on. Its complement in HSL sits at hue 60 + 180 ≈ 243 + 180 = 63°, a yellow-green. Rotate it to 210° from the seed and the accent lands in the warm gold-green range, related to the complement but easier to live with. The neutrals take indigo's hue at very low saturation: a page background at 99% lightness with a whisper of blue, a text color at 10% lightness that is a blue-black rather than pure black.
Weight it 80/20: indigo on the primary button, links, the active nav item and the first chart series; the gold-green on one promotional chip and the single most important metric. Check white text on indigo (passes), dark text on the gold-green (passes), and confirm that the two brand colors separate in grayscale (indigo is darker; they do). In dark mode the indigo lifts toward periwinkle and the gold lifts toward a pale brass, and the relationship holds.
That is the whole method. The palette generator will produce the eight roles from any seed with the complementary rule; the theme generator turns them into a complete Tailwind v4 globals.css with the dark side derived and checked.
Q&A
Question: What is a complementary color scheme?
Short answer: A scheme built from two hues directly opposite each other on the color wheel, such as blue and orange. In HSL terms the second hue is the first rotated 180°. It is the highest-contrast two-color relationship, which is useful for emphasis and dangerous for large areas.
Question: Are complementary colors good for websites and apps?
Short answer: Yes, when used unevenly. Give one hue the primary role across buttons, links and states, and use its complement sparingly for a single point of emphasis per screen. Used at equal weight, complements make the page vibrate and tire the eye.
Question: Can I put complementary colors on top of each other, like orange text on a blue button?
Short answer: No. Even when the contrast ratio passes, opposite hues at similar lightness produce colored fringing and visual vibration along the text edges. Put white or near-black text on colored fills, and keep the two brand colors apart.
Question: What is the difference between complementary and split-complementary?
Short answer: Complementary uses the exact opposite hue. Split-complementary uses the two hues either side of the opposite, 150° and 210° from the seed. It keeps most of the contrast with much less tension and gives you two related accents instead of one — usually the better choice for an interface.
Question: How do complementary schemes change in dark mode?
Short answer: The hues stay the same but both brand colors need their lightness lifted to pass contrast on a dark background, and the accent should cover even less area because bright colors carry more weight on dark surfaces. Deriving dark values from the light roles, rather than choosing them separately, keeps the scheme recognizable in both modes.
shadcn and Tailwind v4
Continue this learning path
Semantic color, typography, spacing, elevation, and dark mode as reusable tokens rather than one-off visual choices.
Design your application
Use the same theme document in a project whose routes, components, data model, and export share one source of truth.
Open projects