Color Lerp / Gradient Steps
Pick two hex colors, get N discrete intermediate steps — in sRGB, linear RGB, OKLab or HSL — with optional easing.
- #3B82F61/7
- #6A7FE72/7
- #8B79D83/7
- #A672C84/7
- #BF68B95/7
- #D65BA96/7
- #EC48997/7
OKLab is the recommended default — Tailwind v4, Radix and modern CSS gradients all interpolate there.
How to use
- Set the start and end hex (or use a preset). Hit ⇄ to reverse them.
- Pick the step count and color space — OKLab is the safest default for design tokens.
- Copy the whole list as hex or HSL, or grab each swatch one at a time.
About this tool
ShowHide
Generates the evenly-spaced colours between two endpoints. A CSS gradient is one continuous band; this gives you discrete swatches you can ship as chart series, status badges or a heatmap legend. The interpolation space is yours to pick, an easing curve can bend the spacing toward either end, and the whole ramp copies out as hex.
The space matters far more than people expect, and one comparison settles it. Interpolate pure red to pure green and take the midpoint: in sRGB you get #808000, a dark olive that looks like a mistake, because averaging the encoded values halves the perceived brightness of both ends at once. In linear RGB — which is what a renderer does, because it is how light actually adds — the same midpoint is #bcbc00, much brighter, arguably too bright. In OKLab it is #d0a800, a warm amber that reads as a step on the path rather than a hole in it.
That dark middle is the classic gradient artefact, and it shows up whenever the two endpoints put their energy in different channels. Blue to yellow, red to cyan, magenta to green all sag in sRGB. Endpoints that share a channel — light blue to dark blue — barely show it, which is why the problem can go unnoticed for years in a palette that happens to be monochrome.
Two notes on the other options. HSL moves along the hue circle and takes the shorter arc, which is usually what you want but occasionally routes a red-to-green ramp through yellow when you expected it through the other side. And the easing curves change where the steps land, not what the endpoints are: ease-out clusters more of them near the start, which is the right shape for a heatmap where the interesting variation is at the low end and you want resolution there rather than in the saturated tail.
Frequently asked questions
Why does OKLab look so much better than sRGB?
Plain sRGB interpolation produces muddy mid-tones because the channels don't track perceived lightness — red+green halfway is a dark olive, not a clean yellow. OKLab is built so equal step sizes look equally different to the eye, so transitions stay bright.
What does the easing curve do?
It controls how the steps space along the gradient. Ease-out clusters more steps near the start (useful for heatmaps where the low end matters more); Ease-in-out puts more detail at both ends.
Why do my steps look uneven even though the numbers are evenly spaced?
Because sRGB values are not proportional to light or to perception. Interpolating in it moves in equal numeric steps, which the eye reads as bunched at one end and stretched at the other, and mixing through the middle can drift towards grey. A perceptual space such as OKLab spaces the steps the way the eye does, which is why the same endpoints produce a visibly better ramp there.
How many steps should a chart or a heatmap legend use?
Fewer than feels natural. People can compare about five to seven shades of one hue reliably, and beyond that a reader stops mapping a swatch back to a value and starts guessing. If you need finer resolution, print the number next to the colour rather than adding steps, and keep the endpoints far enough apart in lightness that the extremes survive a greyscale printout.
Related tools
CSS color-mix() Preview (Interpolation Space Comparison)
Compare how CSS color-mix() blends two colors across interpolation spaces (srgb, hsl, oklch, lab, lch, hwb) — live swatches and copyable CSS.
Color & CSS
CSS Gradient Generator
Build linear or radial CSS gradients with multi-stop colors and copy the code.
Color & CSS
Color Mixer
Interpolate between two colors in RGB, HSL, or CIELAB space. See a gradient strip of intermediate steps.
Color & CSS
Conic Gradient Generator
Visual builder for CSS conic-gradient() — rotate angle, center position, color stops, shape preview.
Color & CSS
OKLCH Color Picker
Pick colours in the perceptually uniform OKLCH space (lightness · chroma · hue) — and see whether each pick fits inside the sRGB display gamut.
Color & CSS
Color Name Finder
Find the closest CSS, Tailwind, or XKCD-survey color name for any hex/RGB input — ranked by perceptual distance in OKLab color space.
Color & CSS