Palette DNA Ramp
Turn your brand color into a full ramp, then build a palette around it. Borrow the character of Tailwind, Radix, Flexoki or your own palette. Select companions, preview them together, and export your colors.
- Input anchor (may be adjusted)
- More vivid than the palette goes
- Lighter or darker than its neighbors, so extrapolated
- Text color with its measured contrast
Build your palette
Start with your brand. Select a reference hue or suggest companions shaped by the same palette.
Suggested companions
Proposals only. Accept a color to add its full ramp; your existing colors stay unchanged.
Edit brand
See your colors together
Contrast & preview method
| Ramp · step | sRGB | WCAG 2 | APCA Lc | Reference levels |
|---|
* Wide-gamut value shown as an sRGB fallback. Contrast uses the original chart colors, not the simulation. 4.5:1 is a normal-text reference; 3:1 is a large-text and meaningful-graphic reference, not a verdict on the whole chart. APCA Lc is advisory, with Lc 75 and Lc 60 as the matching references; it is negative for light marks on a dark background. Labels keep categories identifiable without color alone.
Simulations use Machado, Oliveira & Fernandes (2009), severity 1.0, in linear sRGB. They approximate three deficiencies; individual perception varies. Pair distances use the displayed simulation. No simulation or color-distance score certifies accessibility.
Automatic chart steps favor lightness near 56% on light backgrounds and 72% on dark, with a contrast penalty below 3:1. Change any ramp’s chart step in its editor. These choices do not alter exported ramps.
Color analytics and accessibility
Contrast is checked two ways. WCAG 2 ratios are the standard that regulations cite; APCA scores (Lc) are advisory and model perceived contrast, especially on dark backgrounds. Read how APCA differs from WCAG 2 (from APCA’s authors) and where APCA stands in WCAG 3 (Adrian Roselli).
Brand ramp text contrast
The step closest to the background that passes. WCAG 2 is the pass/fail standard: 4.5:1 for body text, 3:1 for large text and icons. APCA Lc, shown for every step, is advisory: Lc 75 for body text and Lc 60 for other content text (APCA Bronze). Lc is negative for light text on a dark background; the levels apply to its absolute value. APCA isn’t part of any standard yet, so “WCAG 2 and APCA” never picks a step that fails WCAG 2.
Pairings and magic numbers
Each tile shows a step as text on the background. Levels are WCAG 2: AAA is 7:1, AA is 4.5:1 and 3:1 is large text and icons. With “WCAG 2 and APCA” chosen under Brand ramp text contrast, an asterisk (AA*) means APCA falls short of the paired level, Lc 90, 75 or 60; hover a tile for its score. The summary above counts a step as passing only without an asterisk. Δ is the magic number: the gap between the two USWDS grades, from relative luminance. A gap of 40 or more usually gives 3:1, 50 or more 4.5:1 and 70 or more 7:1, but colors near band edges can fall short, so the level shown is measured, not predicted. How to use the magic number.
Lightness and chroma
How colorful each selected ramp is at every lightness. Ramps from the same palette should rise and fall together; a line that breaks from the others is the one to check.
Export your palette
CSS oklch and Tailwind v4 retain wide-gamut color. Hex values in CSS, Tailwind v3 and design tokens are rounded sRGB fallbacks; token extensions also include OKLCH.
Using the magic number
The magic number is a shortcut from the U.S. Web Design System (USWDS) for choosing color pairs that pass contrast without checking every pair. Every color gets a grade from 0 (white) to 100 (black), based on how much light it gives off. The magic number is the difference between two grades. The bigger the gap, the more contrast.
| Magic number | Usually gives | Use it for |
|---|---|---|
| 40 or more | 3:1 | Large text, icons, input borders, focus rings, chart marks |
| 50 or more | 4.5:1 | Body text and labels |
| 70 or more | 7:1 | Long reading, or people who need extra contrast |
A grade-50 color works for body text on both white and black, because it is 50 from each.
Worked example with your brand ramp
1. Give each color a grade. White is 0 and black is 100. Here are your brand steps with their grades; ≈ means the color falls between two official grades and is rounded.
2. Subtract to find the magic number, then read the table above.
3. Confirm with the measured contrast. The magic number gets you close fast; the measured ratio is the final check. Each example above shows it. Pairings and magic numbers does this for every step of every selected ramp.
Write it into your design system
Rules in grades are short enough to remember and work across every hue, so a team doesn’t need a contrast table per color:
Naming steps by grade (brand-60 instead of brand-600) makes the rule readable in code: brand-60 text on brand-5 is 55 apart, so it passes. Only do this when your steps actually land on grades; the next section explains why that isn’t a given.
Where it breaks
- Step names aren’t grades. In Tailwind 4, step 500 is about grade 24 for yellow and 50 for indigo, so “500 on white” means different contrast for each hue. Apply the rule to each color’s grade, not its step name. Palette DNA Map shows how far a palette’s steps wander under Step grades.
- Band edges. Each grade covers a range of lightness. Two colors at the far edges of their ranges can miss: grade 30 against grade 80 can measure 4.44:1, and 40 against 90 can measure 4.23:1. That’s why every example shows the measured ratio.
- WCAG 2 only. Grades follow the WCAG 2 contrast formula. APCA treats light text on dark backgrounds differently and often wants more, which is what the asterisk in Pairings flags.
Why borrow a palette's shape
Formula generators apply the same rule at every hue. That keeps ramps consistent, but it loses the hue-by-hue decisions in palettes their designers authored. In our tests, Material 3, which is generated from a formula, was far easier to rebuild than designer-authored palettes such as Flexoki: a median error of 0.34 against 2.27 ΔE OK ×100, where about 2 is one just-noticeable difference. Not every authored palette is hard to predict: Radix scored 0.82.
This tool reads a palette's shape and fills in the hue you need. We hid each of 184 published ramps and rebuilt it from one of its colors and the palette's other ramps. 66% of the rebuilt steps were within one just-noticeable difference of what the designers shipped, against 55% for copying the nearest ramp. How we measured
Compared with
| Tool | Designed for | This tool adds |
|---|---|---|
| Radix custom palette generator | A Radix-shaped scale from a brand color | The shape of any reference palette, including your own |
| Harmony and Leonardo | Steps that meet contrast targets | The shape of a designer-authored palette |
| Material Theme Builder | A full Material theme | Shapes from outside Material |
| Tailwind-style generators such as uicolors.app | A Tailwind-like scale | Keeping your color exact, and saying which step it landed on |
When not to use it
- You need every step to meet a contrast target: use Harmony or Leonardo.
- You need dark-mode tokens: not supported yet.
- Your palette has fewer than four colored ramps: the tool needs neighboring hues to interpolate between.
- You need a guaranteed categorical chart scheme: companion suggestions are a starting point. Inspect the actual chart colors and use labels or shapes alongside color.
How it works
Each reference palette is treated as a shape. Its ramps are wrapped around a surface in Oklab, a color space where equal distances look about equally different. Your color is placed on that surface by its hue, lightness and colorfulness. The new ramp follows the surface: the same lightness steps, and the same rise and fall in colorfulness, as the palette's own ramps at that hue.
Through color shapes the ramp around your color. Gamut limits, neutral substitution and shared anchor steps can change or omit an input; the result reports those changes. Fits the palette tones a color down if it is more vivid than the palette ever goes at that hue, so the ramp matches its siblings.
Ramp shape. Custom resamples every ramp to 3–32 stops. Each ramp keeps its own lightest and darkest values unless you set a range, and colorfulness is carried as a share of what the gamut allows at each new lightness. A custom shape left at its starting values returns the reference steps unchanged. Your color stays an exact stop unless you turn that off; a range that excludes it is widened and the result says so.
Color sets. Chart color sets such as Tableau 20 have too few steps per hue to act as a reference, so they work as starting colors instead. Add a color set builds one ramp per color, shaped like your reference palette and kept through that color and, where it fits, its lighter pair. The chart preview starts on the set’s own colors. Tableau 20 values are from Tableau’s 2016 redesign and belong to Tableau.
Color analytics. The lightness and chroma chart plots every step of your selected ramps in OKLCH, each in its own color. It shows the values you export, not the color-vision simulation. The chart is drawn with Observable Plot, loaded when the page opens; the rest of the tool works without it.
Your own palette. Choose Import your palette in the Shape it like menu, then paste or upload your color tokens. It needs at least four color ramps that share the same step names. The page validates the colors and keeps the palette in this browser only.
The numbers above come from hiding each real ramp, rebuilding it from its most colorful step, and comparing the result with the shipped ramp. Reported input differences use ΔE OK ×100; zero means the same internal color. Hex exports round to 8-bit sRGB; use CSS oklch for higher precision and wide-gamut colors.
For a deeper look at a palette's shape, open Palette DNA Map. For a similar approach and more creative color explorations, check out dittoTones and other tools by David Aerne.