Palettes by Mood
Five concept palettes with copyable hex codes and a mini poster that recolours with each.
AI prompt
[Subject] in an analog film colour palette: warm faded tones with lifted blacks, muted teal shadows, cream highlights, dominant colours #E8D9B8 cream, #C98B5B terracotta, #4F6B66 faded teal, #2A2623 soft black, accent #D9A441 amber, subtle film grain, slightly low contrast, nostalgic mood. Palette set: tech dark (#0B0F14, #151C26, #2B3646, #E6EDF3, accent #35E0A1), earth tones (#5B4636, #8A7358, #A9A57C, #D8CDB4, accent #B5532E), pastel soft minimal (#F6EEF1, #DDE8E4, #E8E1F2, #FBEFD8, accent #9AA9E8), pop high contrast (#111111, #FFFFFF, #FF3B30, #FFD60A, accent #2F5BFF). Use the dominant colour for about 60 percent of the image. Negative: neon oversaturation, muddy browns, rainbow colours, more than six colours.About this pattern
Definition
A palette is a small set of colours chosen to create a feeling. Naming the mood ("analog film", "tech dark") is more useful in a prompt than listing codes, but codes make the result exact.
When to use it
- Analog film: warm faded tones with lifted blacks, nostalgic and personal.
- Tech dark: near-black surfaces with one electric accent, precise and modern.
- Earth: natural browns, olive and clay, calm and grounded.
- Pastel soft minimal: light, gentle, friendly. Pop: high-contrast saturated colours, loud and playful.
What the controls do
- Choose a mood; click a swatch to copy its hex code; the poster below recolours.
Motion & timing
- Colours transition in 250ms when the mood changes.
- Reduced motion: colours change instantly.
Tips & variations
- Use 60 percent a dominant colour, 30 percent a secondary, 10 percent an accent.
- Check text contrast against the background before using a palette for type.
Code of this live preview
<div class="bx"><div class="tabs" id="tabs" role="group" aria-label="Palette mood"></div><div class="sw" id="sw"></div><p class="hint" id="hint" aria-live="polite">Click a swatch to copy its code</p>
<div class="poster" id="poster"><b>Poster</b><i></i><small>Aa Body text</small></div></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}
.bx{width:min(320px,100%);display:grid;gap:8px}
.tabs{display:flex;gap:4px;flex-wrap:wrap}
.tabs button{height:26px;padding:0 10px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:11.5px;cursor:pointer}
.tabs button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.sw{display:flex;border-radius:12px;overflow:hidden;border:1px solid var(--line);height:56px}
.sw button{flex:1;border:0;cursor:pointer;display:grid;align-items:end;justify-items:center;padding-bottom:5px;font:600 9.5px ui-monospace,Menlo,monospace;transition:flex .2s,background .25s}
.sw button:hover,.sw button:focus-visible{flex:1.7}
.hint{font-size:11.5px;color:var(--muted);min-height:16px}
.poster{height:62px;padding:10px 14px;border-radius:12px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px 10px;transition:background .25s,color .25s}
.poster b{font-size:16px}.poster small{grid-column:1;font-size:11px;opacity:.85}
.poster i{grid-row:1/3;grid-column:2;width:34px;height:34px;border-radius:50%;transition:background .25s}
button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){.sw button,.poster,.poster i{transition:none}}const P={'Analog film':['#E8D9B8','#C98B5B','#4F6B66','#2A2623','#D9A441'],'Tech dark':['#0B0F14','#151C26','#2B3646','#E6EDF3','#35E0A1'],'Earth':['#5B4636','#8A7358','#A9A57C','#D8CDB4','#B5532E'],'Pastel':['#F6EEF1','#DDE8E4','#E8E1F2','#FBEFD8','#9AA9E8'],'Pop':['#111111','#FFFFFF','#FF3B30','#FFD60A','#2F5BFF']};
const tabs=document.getElementById('tabs'),sw=document.getElementById('sw'),hint=document.getElementById('hint'),po=document.getElementById('poster');
const lum=h=>{const c=[1,3,5].map(i=>parseInt(h.slice(i,i+2),16)/255).map(v=>v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4));return .2126*c[0]+.7152*c[1]+.0722*c[2];};
const ink=h=>lum(h)>.4?'#171717':'#ffffff';
function show(n){[...tabs.children].forEach(b=>b.setAttribute('aria-pressed',String(b.textContent===n)));const c=P[n];sw.innerHTML='';
c.forEach(h=>{const b=document.createElement('button');b.style.background=h;b.style.color=ink(h);b.textContent=h;b.setAttribute('aria-label','Copy '+h);b.addEventListener('click',()=>{const done=ok=>{hint.textContent=ok?'Copied '+h:'Press Ctrl+C to copy '+h;};
if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(h).then(()=>done(true),()=>done(false));else done(false);});sw.append(b);});
const bg=c[lum(c[0])>lum(c[3])?0:3];po.style.background=bg;po.style.color=ink(bg);po.querySelector('i').style.background=c[4];hint.textContent='Click a swatch to copy its code';}
Object.keys(P).forEach(n=>{const b=document.createElement('button');b.type='button';b.textContent=n;b.addEventListener('click',()=>show(n));tabs.append(b);});show('Analog film');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>Palettes by Mood — 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}}
.bx{width:min(320px,100%);display:grid;gap:8px}
.tabs{display:flex;gap:4px;flex-wrap:wrap}
.tabs button{height:26px;padding:0 10px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:11.5px;cursor:pointer}
.tabs button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.sw{display:flex;border-radius:12px;overflow:hidden;border:1px solid var(--line);height:56px}
.sw button{flex:1;border:0;cursor:pointer;display:grid;align-items:end;justify-items:center;padding-bottom:5px;font:600 9.5px ui-monospace,Menlo,monospace;transition:flex .2s,background .25s}
.sw button:hover,.sw button:focus-visible{flex:1.7}
.hint{font-size:11.5px;color:var(--muted);min-height:16px}
.poster{height:62px;padding:10px 14px;border-radius:12px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px 10px;transition:background .25s,color .25s}
.poster b{font-size:16px}.poster small{grid-column:1;font-size:11px;opacity:.85}
.poster i{grid-row:1/3;grid-column:2;width:34px;height:34px;border-radius:50%;transition:background .25s}
button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){.sw button,.poster,.poster i{transition:none}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="tabs" id="tabs" role="group" aria-label="Palette mood"></div><div class="sw" id="sw"></div><p class="hint" id="hint" aria-live="polite">Click a swatch to copy its code</p>
<div class="poster" id="poster"><b>Poster</b><i></i><small>Aa Body text</small></div></div>
</div>
<script>
const P={'Analog film':['#E8D9B8','#C98B5B','#4F6B66','#2A2623','#D9A441'],'Tech dark':['#0B0F14','#151C26','#2B3646','#E6EDF3','#35E0A1'],'Earth':['#5B4636','#8A7358','#A9A57C','#D8CDB4','#B5532E'],'Pastel':['#F6EEF1','#DDE8E4','#E8E1F2','#FBEFD8','#9AA9E8'],'Pop':['#111111','#FFFFFF','#FF3B30','#FFD60A','#2F5BFF']};
const tabs=document.getElementById('tabs'),sw=document.getElementById('sw'),hint=document.getElementById('hint'),po=document.getElementById('poster');
const lum=h=>{const c=[1,3,5].map(i=>parseInt(h.slice(i,i+2),16)/255).map(v=>v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4));return .2126*c[0]+.7152*c[1]+.0722*c[2];};
const ink=h=>lum(h)>.4?'#171717':'#ffffff';
function show(n){[...tabs.children].forEach(b=>b.setAttribute('aria-pressed',String(b.textContent===n)));const c=P[n];sw.innerHTML='';
c.forEach(h=>{const b=document.createElement('button');b.style.background=h;b.style.color=ink(h);b.textContent=h;b.setAttribute('aria-label','Copy '+h);b.addEventListener('click',()=>{const done=ok=>{hint.textContent=ok?'Copied '+h:'Press Ctrl+C to copy '+h;};
if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(h).then(()=>done(true),()=>done(false));else done(false);});sw.append(b);});
const bg=c[lum(c[0])>lum(c[3])?0:3];po.style.background=bg;po.style.color=ink(bg);po.querySelector('i').style.background=c[4];hint.textContent='Click a swatch to copy its code';}
Object.keys(P).forEach(n=>{const b=document.createElement('button');b.type='button';b.textContent=n;b.addEventListener('click',()=>show(n));tabs.append(b);});show('Analog film');
</script>
</body></html>