Rim Light Edge Glow
A dark sphere outlined by a thin edge light; slide its angle around the shape and set its strength.
AI prompt
Studio photograph of a dark matte sphere on a near-black background, lit only by a strong rim light from behind and to the right that draws a thin bright crescent along the right edge and fades smoothly around the curve, the front of the sphere falling into deep shadow with just a hint of detail, subtle haze, 85mm lens, cinematic and moody. Variants: the rim on the left, a warm tungsten rim, a cool blue rim on grey. Negative: front light, flat lighting, glare, text, extra objects, rainbow fringes. Reduced motion: static image.About this pattern
Definition
A rim light comes from behind and to the side of the subject and draws a thin bright line along one edge. It separates a dark subject from a dark background and adds shape without lighting the front.
When to use it
- The line should hug the edge and fade out gradually along it, thickest where the light is closest.
- Keep the face or front dark; rim light alone gives a silhouette with an outline.
- Combine with a soft fill from the front when detail is needed.
What the controls do
- An Angle slider, a Strength slider and three backgrounds (Black, Grey, Warm).
Motion & timing
- The rim position and strength follow the sliders directly.
- Reduced motion: no transitions.
Tips & variations
- Place the rim on the shadow side of the key light so each light does its own job.
- Check that the rim does not clip to pure white.
Code of this live preview
<div class="bx"><div class="sc" id="sc"><div class="sp" id="sp"><i></i></div></div><div class="pre" id="pre" role="group" aria-label="Background"><button data-p="0" aria-pressed="true">Black</button><button data-p="1" aria-pressed="false">Grey</button><button data-p="2" aria-pressed="false">Warm</button></div><div class="two"><label class="rw">Angle <b id="av">60°</b><input id="an" type="range" min="0" max="360" value="60"></label><label class="rw">Strength <b id="sv">80%</b><input id="st" type="range" min="0" max="100" value="80"></label></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}
.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}
.sc{height:140px;display:grid;place-items:center;border-radius:12px;background:var(--bgc)}
.sp{width:108px;height:108px;border-radius:50%;position:relative;background:radial-gradient(circle at 50% 50%,#1b1b1f,#0a0a0c)}
.sp i{position:absolute;inset:-1px;border-radius:50%;background:conic-gradient(from calc(var(--a) - 40deg),transparent 0,rgba(255,255,255,var(--s)) 40deg,transparent 80deg);-webkit-mask:radial-gradient(circle,transparent 56%,#000 58%);mask:radial-gradient(circle,transparent 56%,#000 58%);filter:blur(.4px)}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const B=['#050506','#3a3d44','#2a1d14'],sp=document.getElementById('sp'),sc=document.getElementById('sc'),an=document.getElementById('an'),st=document.getElementById('st'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){sc.style.setProperty('--bgc',B[p]);sp.style.setProperty('--a',an.value+'deg');sp.style.setProperty('--s',(st.value/100).toFixed(2));document.getElementById('av').textContent=an.value+'°';document.getElementById('sv').textContent=st.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));an.addEventListener('input',up);st.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>Rim Light Edge Glow — 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}
.sc{height:140px;display:grid;place-items:center;border-radius:12px;background:var(--bgc)}
.sp{width:108px;height:108px;border-radius:50%;position:relative;background:radial-gradient(circle at 50% 50%,#1b1b1f,#0a0a0c)}
.sp i{position:absolute;inset:-1px;border-radius:50%;background:conic-gradient(from calc(var(--a) - 40deg),transparent 0,rgba(255,255,255,var(--s)) 40deg,transparent 80deg);-webkit-mask:radial-gradient(circle,transparent 56%,#000 58%);mask:radial-gradient(circle,transparent 56%,#000 58%);filter:blur(.4px)}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="sc" id="sc"><div class="sp" id="sp"><i></i></div></div><div class="pre" id="pre" role="group" aria-label="Background"><button data-p="0" aria-pressed="true">Black</button><button data-p="1" aria-pressed="false">Grey</button><button data-p="2" aria-pressed="false">Warm</button></div><div class="two"><label class="rw">Angle <b id="av">60°</b><input id="an" type="range" min="0" max="360" value="60"></label><label class="rw">Strength <b id="sv">80%</b><input id="st" type="range" min="0" max="100" value="80"></label></div></div>
</div>
<script>
const B=['#050506','#3a3d44','#2a1d14'],sp=document.getElementById('sp'),sc=document.getElementById('sc'),an=document.getElementById('an'),st=document.getElementById('st'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){sc.style.setProperty('--bgc',B[p]);sp.style.setProperty('--a',an.value+'deg');sp.style.setProperty('--s',(st.value/100).toFixed(2));document.getElementById('av').textContent=an.value+'°';document.getElementById('sv').textContent=st.value+'%';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));an.addEventListener('input',up);st.addEventListener('input',up);up();
</script>
</body></html>