Building gradients that stay smooth in OKLCH

Why gradients look wrong in sRGB and HSL

A gradient is a path through color space, and the space decides what the middle looks like. Interpolating red to green in sRGB passes through a muddy brown-grey, because the straight line between the two RGB points cuts through desaturated colors. HSL avoids some of that but its lightness is not perceptual, so a yellow-to-blue ramp bulges bright in the middle and dips dark at the ends. OKLCH keeps lightness, chroma and hue independent, so the ramp can hold perceived brightness steady while the hue travels — the middle stays vivid instead of washing out.

The lab above interpolates in OKLCH and then samples the result into explicit HEX stops. That means the CSS you copy renders identically everywhere, including browsers without native `linear-gradient(in oklch, …)` support. If you are choosing the endpoint colors themselves, the OKLCH picker shows gamut warnings before a too-saturated endpoint gets clipped into a flat band.

Hue direction: shorter, longer and the muddy middle

Hue is a circle, so between two hues there are always two paths. The shorter arc is the safe default. The longer arc deliberately travels through intermediate hues — a sunset ramp from orange to purple that passes through pink only exists on the long path. What you want to avoid is the path that drags chroma through grey: if the midpoint of your gradient looks dead, the hue path is crossing a low-chroma region; nudge one endpoint's hue or add a deliberate middle stop with the chroma you want.

Keep total hue travel under roughly 120° for UI surfaces (cards, buttons, hero backgrounds) so the gradient reads as one surface rather than a rainbow. Multi-hue ramps have their place in data visualisation and artwork, but then each stop should be a decision, not an accident. The guide to building OKLCH scales covers the related problem of even step ramps.

How many stops, and where to put them

Two or three stops cover most interface work: a subtle same-hue sheen, an accent sweep, a themed hero. Add stops when the hue path needs steering (avoiding a murky midpoint) or when a brand gradient has named waypoints. Because the output is sampled HEX stops, more stops also means a smoother result in the browsers that interpolate between close neighbours. Evenly spaced stops in OKLCH are perceptually even, so you rarely need the manual easing tricks that sRGB gradients demand.

Using the exported CSS

Copy the generated `linear-gradient()` as-is for a background that must match in every browser, or copy individual stops as HEX/OKLCH values into design tokens. Text over gradients still needs checking stop by stop: a pair that passes at one end can fail at the other, so run the lightest and darkest regions through the contrast checker before shipping.

Related tools

  • OKLCH picker
  • Palette diff
  • Studio
Colorise ProOKLCH Engine
ExploreStudioNamesPickerPairs
ExploreStudioNamesPickerPairsContrastExtract
Menu

Product

  • Home
  • Explore
  • Studio
  • Color Names

Tools

  • Picker
  • Color Pairs
  • Contrast
  • Image Extract
  • Gradient Lab
  • Palette Diff
  • Brand from URL

Guides

  • All guides
  • OKLCH vs HSL
  • WCAG vs APCA
  • OKLCH color scales
  • Gamut & sRGB
  • Extract from images
  • HEX to OKLCH
  • Dark mode colors
  • Color meanings

Tools · Gradient

Gradient Lab

Perceptual ramps in OKLCH — compare against HSL, copy CSS that works everywhere, export the stop palette.

OKLCH · 90°

Active · OKLCH

Compare · HSL

Stops

Space

Open stops

Open in Studio

Frequently asked questions

Why interpolate gradients in OKLCH?
OKLCH keeps lightness and chroma perceptually even, so ramps avoid the muddy gray middle and neon banding you get from sRGB or HSL interpolation.
Does the copied CSS work in every browser?
Yes. Colorise Pro samples the OKLCH ramp into explicit hex stops, so the gradient renders identically without relying on `linear-gradient(in oklch, …)` support.
How many stops should a gradient have?
Two or three stops cover most UI surfaces. Use four or five when you need a long hero sweep — keep hue travel under about 120° to stay tasteful.
What is the best color space for gradients?
OKLCH (or its sibling Oklab) for most work: lightness and chroma stay perceptually even along the ramp, so midpoints do not go muddy or flare bright the way sRGB and HSL interpolation do. This lab interpolates in OKLCH and samples the result into HEX stops, so the exported CSS looks the same in every browser.
Why does my gradient have a grey or banded middle?
A grey middle means the hue path crosses a low-chroma region; add a deliberate middle stop with the chroma you want, or shorten the hue travel. Banding usually means the endpoints are far apart in lightness with too few stops — sample more stops, or reduce the lightness range.
Can I use oklch() directly in CSS gradients?
Yes, modern browsers accept linear-gradient(in oklch, …). The exported stops from this tool are plain HEX, which keeps older browsers and email clients rendering the same gradient; choose the native form when you control the browser range and want the file smaller.
Colorise Pro

Free OKLCH color workspace: precision color picker, color pairs, WCAG & APCA contrast checker, palette from image, Studio systems, names, gradients, and brand tools. Export HEX, CSS, Tailwind & DTCG.

OKLCH Engine

Product

  • Home
  • Explore
  • Studio
  • Color Names
  • Color Codes

Tools

  • Color Picker
  • Color Pairs
  • Contrast Checker
  • Image Extract
  • Gradient Lab
  • Palette Diff
  • Brand from URL
  • For presentations
  • For business cards
  • For SaaS landings
  • Duo pairs
  • Trio systems

Guides

  • All guides
  • OKLCH vs HSL
  • WCAG vs APCA
  • OKLCH color scales
  • Gamut & sRGB
  • Extract from images
  • HEX to OKLCH
  • Dark mode colors
  • Color meanings

Legal

  • Privacy
  • Terms

© 2026 {{LEGAL_ENTITY_NAME}}. All rights reserved.

© 2026 Colorise Pro. Built for precision color work.

Report infringement: {{CONTACT_EMAIL}} ({{LEGAL_ENTITY_NAME}})

PrivacyTermsOKLCH · WCAG · APCA