Grainy Gradient Backgrounds
Smooth gradients with a grain layer on top, with a slider to go from clean to gritty.
AI prompt
Abstract background image: a soft three-colour gradient from peach to coral to deep violet sweeping diagonally across the frame, covered with a fine uniform film-like grain that gives the surface a printed, tactile feel, no banding, no objects, no text, subtle vignette, high resolution wallpaper. Variants: aurora green to blue, sunset yellow to magenta, deep ocean teal to navy. Negative: harsh noise, rainbow colours, shapes, borders, blur halos. Reduced motion: static image.About this pattern
Definition
A pure gradient can look flat or show visible bands. Adding a fine noise layer in overlay mode breaks the bands up and gives the background a printed, tactile feel. The noise is made by an SVG filter, so no image file is needed.
When to use it
- Use a three-stop gradient with colours close in lightness; noise then adds depth instead of dirt.
- Blend the noise with overlay so it lightens the dark parts and darkens the light parts evenly.
- Keep the grain subtle for UI backgrounds; heavier grain suits posters.
What the controls do
- Four palettes and a Grain slider.
Motion & timing
- Grain opacity updates live; nothing animates.
- Reduced motion: nothing to change.
Tips & variations
- Keep text off the grainiest areas or increase its weight.
- Apply the noise to one large layer, not to many small elements.
Code of this live preview
<svg width="0" height="0" aria-hidden="true" focusable="false"><filter id="gn" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="2" seed="8"/><feColorMatrix values=".33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1"/></filter></svg><div class="bx"><div class="pl" id="pl"><div class="nz" id="nz"></div><b>Soft gradient</b></div><div class="pre" id="pre" role="group" aria-label="Palette"><button data-p="0" aria-pressed="true">Sunset</button><button data-p="1" aria-pressed="false">Aurora</button><button data-p="2" aria-pressed="false">Candy</button><button data-p="3" aria-pressed="false">Ocean</button></div><label class="rw">Grain <b id="gv">60%</b><input id="gr" type="range" min="0" max="100" value="60"></label></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pl{height:132px;border-radius:14px;position:relative;overflow:hidden;display:grid;place-items:center;background:linear-gradient(135deg,var(--c1),var(--c2),var(--c3));color:#fff;box-shadow:0 6px 16px rgba(0,0,0,.16)}
.nz{position:absolute;inset:0;filter:url(#gn);mix-blend-mode:overlay;opacity:var(--g)}
.pl b{position:relative;font-size:20px;letter-spacing:-.02em;text-shadow:0 1px 8px rgba(0,0,0,.2)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const Pa=[['#ffb88a','#ff6f6a','#5b3a9e'],['#a8f0c6','#2fb5c9','#2a3f9e'],['#ffe27a','#ff7aa8','#9a5bf0'],['#7fd6d6','#1f6f9e','#10264a']],pl=document.getElementById('pl'),gr=document.getElementById('gr'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){Pa[p].forEach((c,i)=>pl.style.setProperty('--c'+(i+1),c));pl.style.setProperty('--g',gr.value/100);document.getElementById('gv').textContent=gr.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));gr.addEventListener('input',up);up();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Grainy Gradient Backgrounds — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pl{height:132px;border-radius:14px;position:relative;overflow:hidden;display:grid;place-items:center;background:linear-gradient(135deg,var(--c1),var(--c2),var(--c3));color:#fff;box-shadow:0 6px 16px rgba(0,0,0,.16)}
.nz{position:absolute;inset:0;filter:url(#gn);mix-blend-mode:overlay;opacity:var(--g)}
.pl b{position:relative;font-size:20px;letter-spacing:-.02em;text-shadow:0 1px 8px rgba(0,0,0,.2)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<svg width="0" height="0" aria-hidden="true" focusable="false"><filter id="gn" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="2" seed="8"/><feColorMatrix values=".33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1"/></filter></svg><div class="bx"><div class="pl" id="pl"><div class="nz" id="nz"></div><b>Soft gradient</b></div><div class="pre" id="pre" role="group" aria-label="Palette"><button data-p="0" aria-pressed="true">Sunset</button><button data-p="1" aria-pressed="false">Aurora</button><button data-p="2" aria-pressed="false">Candy</button><button data-p="3" aria-pressed="false">Ocean</button></div><label class="rw">Grain <b id="gv">60%</b><input id="gr" type="range" min="0" max="100" value="60"></label></div>
</div>
<script>
const Pa=[['#ffb88a','#ff6f6a','#5b3a9e'],['#a8f0c6','#2fb5c9','#2a3f9e'],['#ffe27a','#ff7aa8','#9a5bf0'],['#7fd6d6','#1f6f9e','#10264a']],pl=document.getElementById('pl'),gr=document.getElementById('gr'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){Pa[p].forEach((c,i)=>pl.style.setProperty('--c'+(i+1),c));pl.style.setProperty('--g',gr.value/100);document.getElementById('gv').textContent=gr.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));gr.addEventListener('input',up);up();
</script>
</body></html>