We're live on Product Hunt!Support us
ColorArchive

A curated color library with 5,000+ algorithmically generated colors. Browse, search, save favorites, and export palette tokens — no account required.

CollectionsFamiliesNotesGuidesFree ResourcesConvertColorblindAboutSupportUpdates
Ready for static export
Privacy·Terms·Refunds·Cookies·Commerce Disclosure
colorarchive.org · © 2026 ColorArchive
Skip to content
ColorArchive
ProLog in
ArchiveAll ColorsCollections
Visual Design
Search intent: gradient design UI CSS gradient background gradient palette

Gradients in UI Design: Functional vs Decorative and How to Use Both

A framework for using gradients well — understanding what gradients communicate, avoiding common failures like the muddy middle, and building gradients that survive palette changes.

UI DesignCSSColor TheoryVisual Design
Key points
Gradients transitioning between hues via HSL interpolation often produce a desaturated 'muddy middle' — OKLCH interpolation solves this with perceptually uniform transitions.
A gradient communicates movement, depth, and energy simultaneously; when those signals conflict with the design's intent, the gradient adds noise rather than meaning.
Define gradients as named tokens in design systems (--gradient-hero-background) rather than ad-hoc in components — rebrand updates propagate automatically.

What gradients communicate

Before deciding whether to use a gradient, understand what it will communicate. Gradients communicate three things simultaneously: movement (the eye follows the gradient's direction of transition), depth (a gradient from lighter at the top to darker at the bottom reads as a surface curving away from the viewer), and energy (high-saturation gradients read as dynamic and playful; muted gradients read as calm and sophisticated). When these effects align with design intent, a gradient adds meaning. When they conflict — a 'trustworthy, stable, financial' brand using a vivid, high-energy gradient — the gradient creates visual noise by implying qualities the brand does not intend. The design question before adding a gradient is always: what does this specific gradient communicate, and does that match what this surface needs to say?

The muddy middle problem and perceptual gradients

The most common gradient failure is the muddy middle: a gradient between two pure hues that passes through an unpleasant, desaturated zone at the midpoint. A gradient from red to blue interpolated through HSL crosses the hue wheel through purple-to-near-gray in a way that looks muddy and unintended. The problem is that HSL is not a perceptually uniform color space — equal steps in HSL produce unequal perceptual steps, and hue transitions between some color pairs cross through near-gray zones. The solution is perceptual color space interpolation. CSS now supports OKLCH gradients: background: linear-gradient(in oklch, red, blue) produces a vivid, perceptually uniform transition through violet rather than the muddy HSL path. For any hue-to-hue gradient, OKLCH is the correct interpolation space.

Functional gradient applications

Several functional gradient patterns are reliable across interface types. Surface depth on cards: a very subtle top-to-bottom lightness gradient (2-3% lightness difference) on a large card surface reads as physical depth without drawing attention to itself. Text legibility overlay: a gradient from transparent to 60-70% black at the bottom of a photographic area ensures text contrast without a hard edge line — ubiquitous in media, content, and hero sections. Focus and attention gradient: a radial gradient glow behind a featured element or active state uses the eye-following property of gradients to draw attention to the active component. Status gradients: subtle background gradients in success/warning/error banners add visual distinctiveness to feedback without relying solely on color hue, which is important for color-blind accessibility.

Gradients in design systems

Gradients are harder to maintain in design systems than flat colors because they are defined by multiple color stops, not a single value. When brand colors change, gradient definitions must be manually updated. The solution is gradient tokens: define named gradient presets with semantic references — --gradient-hero-background: linear-gradient(in oklch, var(--brand-primary-light), var(--brand-primary-dark)). Component gradients reference the gradient token rather than raw values. When the brand palette changes, updating the primitive tokens automatically updates every gradient token, which automatically updates every component using it. Ad-hoc gradients defined with raw hex values in component files are a maintenance debt. Audit for them regularly and migrate to token references.

Featured collection
Neon After Dark

Cyber neon colors on deep dark bases for gaming, nightlife, and bold tech products.

Open collectionAll collections
Open next
Tints and shades generatorColor harmony toolNeon After Dark collection
Practical next step

Move from the guide into a concrete palette lane

Guides explain the use case. Collections prove the taste. Pro handles the export and implementation layer.

Upgrade to ProMore guides
Related guides
Dark Mode
Building a Dark Mode Color Palette: Beyond Inverting Light Mode
A practitioner's guide to dark mode color design — the specific lightness, saturation, and elevation decisions that make dark mode interfaces feel polished rather than merely dark.
Advanced Color
Gradient Design: Chromatic Progressions That Feel Contemporary
Gradients are back — but the contemporary gradient is nothing like the early 2000s lens flare era. A framework for mesh gradients, chromatic progressions, and tonal ramps that feel intentional.
UI Design
Dark Mode Color Palette Guide: Building Accessible, Beautiful Dark Interfaces
Dark mode design has unique requirements that differ fundamentally from light mode. This guide explains the key principles: surface layering with dark grays (not black), color temperature consistency, semantic token architecture, and how to handle elevation and depth without shadows.