miwale

Shadow Theatre — Game Art Style Spec

Backlit paper shadow-puppet theatre: indigo-black cut-paper silhouettes over glowing teal, violet, crimson and amber light fields.

The screen is a lit puppet stage seen from above. The floor is the light: big organic colour fields (moonlit teal, dusk violet, crimson, amber) glow like a backlit paper screen. They are joined by thin ink seams threaded with lace beads and covered in flat ink cut-outs: grass tufts, leaves, filigree scrolls, dandelion clocks and stars. Everything that stands is a flat silhouette in indigo-black ink #0b0510, built from tapered strokes, lens leaves and spiral curls in the tradition of Lotte Reiniger's cut-paper silhouette films. The only colour on a silhouette is emissive: the main character's carved, glowing pumpkin face, the small creatures' acid-green eyes, the large creature's magenta cracks. There is also a soft baked rim of light. Veil-like ghost creatures invert the rule and are pale glowing veils. Velvet curtains, a scalloped valance and a vignette frame the scene as a theatre.

At a glance

FamilySilhouette · Paper Shadow Puppets
Moodfairy-tale gothic, warm, mysterious, theatrical, cosy-spooky
Best fortop-down action with crowded scenes, halloween & folklore projects, silhouette puzzle-platformers, storybook adventures
RendererCanvas 2D, fully procedural (no image assets)
Pixel artNo – smooth, anti-aliased, sprites baked at K ≈ 1.3 × (screen px / 360) px per world unit
Complexity4/10 – a new silhouette is quick to draw; making many creature types readable by outline alone takes thought
FontsCinzel (numbers, titles), IM Fell English SC (small-caps labels), Cormorant Garamond (body)
Key coloursink #0b0510, amber #ffc662, crimson #f26a52, violet #b682dc, teal #76ccc6, face gold #ffd65e, eye green #d8ff62, crack magenta #ff5ad2

When to use it

Color palette

SwatchHexRole
Shadow Ink#0b0510Every silhouette, prop, curtain and HUD plate (25–35 % of the screen)
Lace Ink#16081cGround seams (85 %) and lace decals (layer at 80 %)
Amber Core / Edge#ffc662 / #ea7a2cWarm amber field: centre / near seams (largest field type)
Hot Gold#fff0c4Hot heart deep inside amber fields
Crimson Core / Edge#f26a52 / #b02a42Crimson field
Violet Core / Edge#b682dc / #6840a2Dusk-violet field
Moon Teal Core / Edge#76ccc6 / #2c748cMoonlit water field (ripple highlights rgb(215,255,245))
Face Core → Ember#fffbe2 → #ffd65e → #ff9a22 → #ff6a10Carved face gradient (radial), bloom rgba(255,150,40,.95)
Main Rim#ffb24aThe main character's permanent rim of light
Eye Green#d8ff62Small-creature eyes: #ffffe0 → #d8ff62 → #7fe02a, bloom rgba(170,255,70,.95)
Crack Magenta#ff5ad2Large-creature cracks (stroke #ffb8f0, shadow rgba(255,70,210,1)), core and eyes
Veil White#dcefffGhost veil: #fbfdff → #dcefff → #a9d4ff
Ghost Hollow#1c0f36Ghost eye/mouth holes
Gem Aqua#3fe0d8Small collectible gem (#fff → #b8fff4 → #3fe0d8); large gem #fff0a8 → #ffb03a
Velvet#2a0a20, #240818Curtain sheen stripes
HUD Gold#ffd98aHUD headings; hairline rgba(255,196,120,.55)

Exact field colours (RGB, edge → core): teal [44,116,140]→[118,204,198], violet [104,64,162]→[182,130,220], crimson [176,42,66]→[242,106,82], amber [234,122,44]→[255,198,98].

Palette rules

Typography

Text effects:

Rendering technique

The world is drawn in world units with 360 units visible vertically. The main character is about 18 units wide and 33 tall.

  1. Init: pick the bake resolution. K = clamp(round(screenHeightPx / 360 × 1.3 × 4) / 4, 2.5, 5) px per world unit (DPR is capped at 2). The extra 1.3 keeps silhouettes crisp when they are slightly scaled.
  2. Bake every sprite with mk(x0, y0, x1, y1, draw, pad). It creates a canvas of (x1 − x0 + 2·pad) × K px and sets the transform to K. Fill and stroke are #0b0510 with round caps and joins. The draw function then paints in world units with feet at (0, 0) and the figure facing +x.
  3. Per sprite, also bake:
    • a mirrored copy, for facing −x;
    • a rim-light copy rimSpr(s, colour, rad): tint the silhouette, stamp it 8 times around a circle of d = rad·K·0.55 px, blur by d, then add the unblurred stamps at 60 %;
    • for the main character, a white "hurt" rim (rad 1.1);
    • for creatures, torn-paper shard sets for the break-up animation.
  4. Bake glows as radial-gradient squares: glowSpr(radius, stops). Examples: the warm pool (r 30), the face halo (r 9), gold (r 10), pink (r 12), cyan (r 6), embers (r 3) and the dark contact shadow (r 10, rgba(14,5,20,.55)).
  5. Ground chunks of 256 world units are rendered by a generator (see World and ground) at up to 2.5 px per unit, then cached.
  6. Per frame, in order:
    • ground chunks;
    • contact shadows and the main character's additive follow-spot;
    • props, creatures, main character, collectibles, orbiting objects and projectiles, all y-sorted;
    • particles;
    • pop-up numbers;
    • the theatre-frame overlay, baked once per screen size.
  7. Light is always additive. Glows, rims, embers, flares and trails use globalCompositeOperation = 'lighter'. Ink is drawn with normal source-over.
  8. Blit with world-unit sizes. Draw with drawImage(c, x − ax/K, y − ay/K, w/K, h/K), and snap positions to device pixels when not rotating. Wobble and sway use a rotate transform around the feet.

World and ground

The floor is a light field shader, computed per pixel from one scalar noise value. It is the brightest, most colourful layer of the picture; everything standing on it is flat ink #0b0510.

f(x, y) = (warped(x/1300, y/1300, seed 501, warp 0.85, 3 oct) − 0.5) × 9.5 + (fbm(x/420, y/420, seed 502, 2 oct) − 0.5) × 0.9

Scale: fields are hundreds of units across (noise period about 1300 units), so one screen shows 2–4 fields. Decals are tiny: 2–15 units, with strokes of 0.25–0.85 units. Keep decals much finer than the standing figures so the floor never competes with them.

Characters

All characters are shadow puppets: flat #0b0510 silhouettes with no outline and no shading, built from ellipses, tapered limbs (Catmull-Rom-smoothed polylines filled as ribbons), lens leaves, spiral curls and cut-out holes. They face +x and are mirrored for −x. Every tip (toes, tails, stems, crowns) ends in a curl or a leaf. Faces are holes or emissive shapes, never painted features. Each character class has a unique outline and exactly one emissive colour.

The main character (a slim puppet figure with a round pumpkin head, a jagged cloak and a streaming scarf) measures about −14…9 units in x and −33…1.5 units in y, with the feet at the origin. Draw order, back to front:

  1. Back leg. A jointed puppet leg: hip → knee (4.2 units) → foot (4.4 units) as a limb 1.15 → 0.9 wide. The foot is a 1.4 → 0.7 limb ending in a toe curl (2.2 long, turn −5.5).
  2. Back arm. Shoulder at (−1.6, sh + 0.8), upper arm 3.4, forearm 3.2, a 1.0-unit limb ending in a hand circle (r 0.85).
  3. Front leg.
  4. Cloak. From the shoulders (y = −16.2 + bob) to a jagged hem of 7 zig-zag points alternating +1.3 / −0.7. The hem trails backwards by 2.2 units when walking. A small clasp curl sits at the back edge.
  5. Scarf. An ellipse (3.5 × 1.3) plus two streaming tails: limbs 1.6 → 0.5, 11.6 units long when walking, hanging down when idle, waving at twice the step frequency.
  6. Front arm. Width 1.1.
  7. Pumpkin head. Four overlapping ellipses (pumpkinShape, rx 6.8, ry 5.4) at (0.8, −22.4). Add a stem limb (1.5 → 0.9) curving back, a leaf (4.2 long) and a long spiral curl (4.6, turn 6).
  8. Carved face, the brightest thing on screen. Two triangular eyes, a triangle nose and a zig-zag grin with two teeth. It is filled by glowFill with the radial FACE gradient (#fffbe2 → #ffd65e → #ff9a22 → #ff6a10, centre radius 6) and a 1.6-unit bloom in rgba(255,150,40,.95).

Frames. There are 6 walk frames (phase i/6) and 4 idle frames, each baked with a warm rim (#ffb24a, rad 1.3), a white hurt rim and mirrored copies. The walk bob is −|cos(phase)| × 0.9, and the head bobs separately with a 0.4 phase lag.

Per frame:

The main character is always rim-lit and stands in its warm follow-spot, so it wins against any crowd of creatures.

Small creature (a purple root-bulb puppet with a leafy filigree crown, about 24 × 30 units):

It has 2 variants × 6 frames and rocks ±0.075 rad as it walks.

Fast creature / ghost:

It has 4 frames and hovers. Keep ghosts cold (blue-white) so they never compete with the warm face of the main character.

Large creature (a hulking root-bulb colossus, about 44 × 62 units):

It has 6 frames and rocks ±0.035 rad.

Readability in crowds. Bodies all merge into one ink mass, so identity comes from:

  1. the outline features that stick out (crowns, veils, antlers);
  2. the emissive colour code (green dots = small creatures, magenta = large creatures, white = ghosts, gold = main character);
  3. the main character's constant warm rim and spotlight.

Test every new silhouette at 30 px tall in ink only. Creatures only get a rim during an impact flash (cream #fff6dc, capped at 0.9, or 0.7 for large creatures). Never give them a permanent rim.

Props

Props are standing ink silhouettes in #0b0510, baked once at K px per world unit and y-sorted together with the characters. They use the same vocabulary as the characters — tapered limbs, lens leaves, spiral curls, destination-out holes where light shows through — and no outlines or shading. Light on props is only emissive (lantern panes, carved faces) plus additive glows.

Placement. Props are scattered on a cell grid and filtered by field: trees in 118-unit cells with a field-dependent chance (teal 40 %, violet 50 %, crimson 30 %, amber 14 %); graves cluster where a low-frequency noise (x/330) is above 0.64 and never on amber; fences (zone 0.56–0.62) and gates (zone above 0.62) in 150-unit cells; scarecrows, crow posts and gourd lanterns only on the warm crimson and amber fields; lantern poles anywhere (135-unit cells, 22 %); weeds in 44-unit cells (40 %), grass on teal, ferns on violet, thistles or grass on warm fields. Props stay away from seams.

Motion. Trees sway ±0.012 rad and scarecrows ±0.02 rad at 0.7 rad/s, hinged at the foot like puppets. Weeds sway ±0.05 rad at 1.3 rad/s. The crow flicks its head on every 4th beat (0.8 Hz). Lanterns and gourd lanterns flicker with 0.75 + 0.15·sin(9t) + 0.1·sin(23t).

Shadows. Every prop gets a squashed dark contact shadow (rgba(14,5,20,.55) → 0) whose width comes from the prop's sh value: trees 1.9, gates 1.8, fences 1.4, scarecrows 1.0, gourd lanterns 0.9, graves 0.75, weeds 0.6, crow posts and lantern poles 0.5.

Effects and particles

All effects are either light (additive, 'lighter') or paper (flat ink). Nothing is mid-tone.

Atmosphere and lighting

The scene is lit from below and behind the paper — the glowing floor is the light source. Standing objects are flat ink #0b0510; all extra light is added with globalCompositeOperation = 'lighter', never by brightening ink.

UI

HUD pieces are ink plates with a gold hairline: an ink ring, a hairline ring (rgba(255,196,120,.55)), a second ink ring and a warm outer glow. Bars have glowing gradient fills inset 4–6 px. Numbers are Cinzel with an orange glow. The timer sits in a plate with a rounded-bottom "lambrequin" shape and has ink scroll ornaments (SVG) on both sides. Icons sit on a glowing radial disc (#fff3c8 → #ffc35a → #ea6236 → #7a1c46) with an ink border ring of 24 alternating beads, and the icon art is ink silhouettes with small emissive faces. Choice cards are tiny stages: an amber-to-crimson radial glow, an ink curtain and scalloped valance cut-out over the top and sides, an ink stage-lip arc at the bottom with the key number in glowing gold, and a lift of 8 px plus a bigger glow on hover. Overlays darken the stage with a warm radial vignette.

.hud { font-family: 'Cormorant Garamond', Georgia, serif; color: #ffe9c4; }
.bar { height: 18px; background: #0b0510; border-radius: 9px; position: relative;
  box-shadow: 0 0 0 2px #0b0510, 0 0 0 3px rgba(255,196,120,.55), 0 0 0 5px #0b0510, 0 0 16px 2px rgba(255,80,60,.35); }
.bar > .fill { position: absolute; top: 6px; bottom: 6px; left: 4px; border-radius: 3px;
  background: linear-gradient(90deg, #a0103a, #ff4a36 55%, #ffc39a); box-shadow: 0 0 6px #ff7a5a, 0 0 14px rgba(255,60,50,.9); }
.bar.progress > .fill { background: linear-gradient(90deg, #ff5a1f, #ffb347 55%, #fff4cc); box-shadow: 0 0 6px #ffc46a, 0 0 14px rgba(255,120,40,.9); }
.panel { background: #0b0510; padding: 4px 30px 6px; border-radius: 6px 6px 40px 40px / 6px 6px 22px 22px;
  box-shadow: inset 0 0 0 1px rgba(255,196,120,.55), 0 0 0 3px #0b0510, 0 0 22px 4px rgba(255,140,60,.35); }
.timer { font: 900 34px/1.05 'Cinzel', Georgia, serif; letter-spacing: 3px; color: #ffe4a6;
  text-shadow: 0 0 6px rgba(255,170,70,1), 0 0 16px rgba(255,110,40,.8); }
.label { font: 13px 'IM Fell English SC', Georgia, serif; letter-spacing: 3px; color: #f4c99a; border-top: 1px solid rgba(255,196,120,.55); }
.pill { background: #0b0510; padding: 1px 16px 2px; border-radius: 16px; color: #ffe4a6; font: 700 22px 'Cinzel', serif;
  box-shadow: inset 0 0 0 1px rgba(255,196,120,.55), 0 0 14px 2px rgba(255,140,60,.35); text-shadow: 0 0 8px rgba(255,150,60,.9); }
.card { width: 228px; min-height: 318px; color: #0b0510; border: 3px solid #0b0510; border-radius: 12px 12px 6px 6px;
  background: radial-gradient(ellipse 80% 70% at 50% 52%, #fff2c8 0%, #ffc45e 30%, #f0743a 60%, #b02c48 84%, #4a1438 100%);
  box-shadow: 0 0 0 2px rgba(255,196,120,.55), 0 0 0 6px #0b0510, 0 0 34px 6px rgba(255,130,50,.4); }
.card:hover { transform: translateY(-8px); box-shadow: 0 0 0 2px #ffd98a, 0 0 0 6px #0b0510, 0 0 48px 12px rgba(255,150,60,.65); }
.overlay { background: radial-gradient(ellipse at 50% 48%, rgba(255,140,60,.28), rgba(40,8,30,.7) 45%, rgba(8,2,12,.92) 80%); }

Alert state of the red bar (e.g. when the main character is hurt): the hairline turns #ff8a6a and the glow grows to 0 0 26px 6px rgba(255,60,40,.8).

Motion and animation

Everything moves like a rod puppet: jointed limbs swing, and whole sprites rock around the feet.

Do and don't

Do

Don't

Implementation recipe

  1. Set up a world-unit camera (360 units tall). Compute K = clamp(round(hPx / 360 × 1.3 × 4) / 4, 2.5, 5).
  2. Implement the toolkit: spline, limb(pts, w0, w1), curlPts/curl, leaf, ell, circ, poly, star, cut, pumpkinShape (or your own primitive bulb) and glowFill.
  3. Implement mk() (bake at K, feet at origin, ink fill), flip, tint, rimSpr (8 stamps + blur) and glowSpr.
  4. Design the main character as a puppet: torso and cloak, jointed limbs with curl tips, a distinctive head with one emissive feature. Bake 6 walk + 4 idle frames with rim copies.
  5. Design each creature class with a unique protruding feature and one emissive colour. Bake 4–6 frames each, plus an impact rim and torn shards.
  6. Write the ground shader: one warped-noise scalar → 4 threshold bands → edge-to-core colour → light bleed near the seam → optional ripples → paper grain → seam line. Use a 4-unit sample grid with bilinear interpolation, and render chunks in a generator.
  7. Draw the lace layer: seam beads projected onto sd = 0, then field-specific ink decals. Composite it at 80 %.
  8. Bake props as silhouettes, scatter them by field (warm props on amber and crimson, reeds on teal) and y-sort them with the characters.
  9. Per frame: draw the ground, contact shadows, the main character's spotlight, y-sorted sprites (rim 'lighter' first, then ink), additive emissive halos, particles and numbers, then the theatre frame.
  10. Effects: additive flares, sparks, embers and trails; ink paper scraps; torn-shard break-ups.
  11. Build the HUD with ink plates, gold hairline rings, glowing gradient bars and Cinzel numbers.

Code

These are the core techniques, ported from the reference module so they run standalone. starter.js has the complete runnable kit: ground shader, lace, main character, small creature, ghost, large creature, gems, projectile, frame. The full reference is ../../js/styles/shadow.js.

// Tapered cut-paper limb along a Catmull-Rom-smoothed polyline (the basic building block).
function spline(p, sub) {
  const o = [];
  for (let i = 0; i < p.length - 1; i++) {
    const p0 = p[i - 1] || p[i], p1 = p[i], p2 = p[i + 1], p3 = p[i + 2] || p[i + 1];
    for (let k = 0; k < sub; k++) {
      const t = k / sub, t2 = t * t, t3 = t2 * t;
      o.push([0, 1].map((j) => 0.5 * (2 * p1[j] + (-p0[j] + p2[j]) * t + (2 * p0[j] - 5 * p1[j] + 4 * p2[j] - p3[j]) * t2 + (-p0[j] + 3 * p1[j] - 3 * p2[j] + p3[j]) * t3)));
    }
  }
  o.push(p[p.length - 1]);
  return o;
}
function limb(c, pts, w0, w1, sub) {
  const s = pts.length > 2 ? spline(pts, sub || 5) : pts, n = s.length, L = [], R = [];
  for (let i = 0; i < n; i++) {
    const a = s[Math.max(0, i - 1)], b = s[Math.min(n - 1, i + 1)];
    let dx = b[0] - a[0], dy = b[1] - a[1]; const d = Math.hypot(dx, dy) || 1; dx /= d; dy /= d;
    const w = (w0 + (w1 - w0) * (i / (n - 1))) * 0.5;
    L.push([s[i][0] - dy * w, s[i][1] + dx * w]); R.push([s[i][0] + dy * w, s[i][1] - dx * w]);
  }
  c.beginPath(); c.moveTo(L[0][0], L[0][1]);
  for (let i = 1; i < n; i++) c.lineTo(L[i][0], L[i][1]);
  for (let i = n - 1; i >= 0; i--) c.lineTo(R[i][0], R[i][1]);
  c.closePath(); c.fill();
  c.beginPath(); c.arc(s[0][0], s[0][1], w0 / 2, 0, Math.PI * 2); c.fill();
}
// Spiral that tightens towards its end – every tip in this style finishes in one.
function curlPts(x, y, a, len, turn, n = 12) {
  const p = [[x, y]]; let h = a;
  for (let i = 0; i < n; i++) {
    const t = i / n; h += (turn * (0.25 + 1.75 * t)) / n;
    const s = (len / n) * (1.35 - 0.85 * t);
    x += Math.cos(h) * s; y += Math.sin(h) * s; p.push([x, y]);
  }
  return p;
}
// usage: ctx.fillStyle = '#0b0510'; limb(ctx, curlPts(0, 0, -1.2, 6, 5.5), 0.8, 0.1, 3);
// Emissive fill (carved face / eyes / lantern pane): gradient + baked bloom. K = px per world unit.
const FACE = [[0, '#fffbe2'], [0.35, '#ffd65e'], [0.75, '#ff9a22'], [1, '#ff6a10']];
function glowFill(c, path, cx, cy, r, stops, bloom, bloomCol, K) {
  c.save();
  const g = c.createRadialGradient(cx, cy, 0, cx, cy, r);
  stops.forEach((s) => g.addColorStop(s[0], s[1]));
  c.fillStyle = g;
  c.shadowColor = bloomCol; c.shadowBlur = bloom * K;   // pass 1: bloom halo
  c.beginPath(); path(c); c.fill();
  c.shadowBlur = 0;                                     // pass 2: crisp shape on top
  c.beginPath(); path(c); c.fill();
  c.restore();
}
// Hole in the paper: the floor light shows through.
function cut(c, fn) { c.save(); c.globalCompositeOperation = 'destination-out'; c.fillStyle = '#000'; fn(); c.restore(); }
// Rim of light around a baked silhouette (main character aura, impact flash). Add it with 'lighter' BEFORE the ink sprite.
function tint(src, col) {
  const c = document.createElement('canvas'); c.width = src.width; c.height = src.height;
  const x = c.getContext('2d'); x.drawImage(src, 0, 0);
  x.globalCompositeOperation = 'source-atop'; x.fillStyle = col; x.fillRect(0, 0, c.width, c.height);
  return c;
}
function rimSprite(src, color, rad, K) {          // rad in world units: main character 1.3, small creature 1.2, large creature 1.6
  const t = tint(src, color), d = Math.max(1, rad * K * 0.55);
  const tmp = document.createElement('canvas'); tmp.width = src.width; tmp.height = src.height;
  const tc = tmp.getContext('2d');
  for (let i = 0; i < 8; i++) { const a = (i / 8) * Math.PI * 2; tc.drawImage(t, Math.cos(a) * d, Math.sin(a) * d); }
  const out = document.createElement('canvas'); out.width = src.width; out.height = src.height;
  const oc = out.getContext('2d');
  oc.filter = `blur(${d.toFixed(1)}px)`; oc.drawImage(tmp, 0, 0); oc.filter = 'none';
  oc.globalAlpha = 0.6; oc.drawImage(tmp, 0, 0);
  return out;
}
// per frame: ctx.globalCompositeOperation = 'lighter'; ctx.globalAlpha = 0.75; ctx.drawImage(rim, …);
//            ctx.globalCompositeOperation = 'source-over'; ctx.globalAlpha = 1; ctx.drawImage(ink, …);
// Ground light fields: one noise scalar f → four glowing bands. Per pixel, add bleed, seam line, grain.
const TH = [-0.95, -0.3, 0.35], BW = 0.075, HOT = [255, 240, 196];
const BANDS = [ { e: [44,116,140], c: [118,204,198] }, { e: [104,64,162], c: [182,130,220] },
                { e: [176,42,66], c: [242,106,82] },   { e: [234,122,44], c: [255,198,98] } ];
const ss = (a, b, x) => { let t = Math.min(1, Math.max(0, (x - a) / (b - a))); return t * t * (3 - 2 * t); };
function bandCol(i, f, gloss, o) {
  let d = i === 0 ? TH[0] - f : i === 3 ? f - TH[2] : Math.min(f - TH[i - 1], TH[i] - f); if (d < 0) d = 0;
  const B = BANDS[i], t = ss(0, 0.75, d) * (0.55 + 0.45 * gloss);
  for (let k = 0; k < 3; k++) o[k] = B.e[k] + (B.c[k] - B.e[k]) * t;
  if (i === 3) { const h = ss(0.9, 2.2, d) * (0.25 + 0.4 * gloss); for (let k = 0; k < 3; k++) o[k] += (HOT[k] - o[k]) * h; }
}
function fieldColor(f, gloss, out) {
  const s0 = ss(TH[0] - BW, TH[0] + BW, f), s1 = ss(TH[1] - BW, TH[1] + BW, f), s2 = ss(TH[2] - BW, TH[2] + BW, f);
  const w = [1 - s0, s0 - s1, s1 - s2, s2], t = [0, 0, 0]; out[0] = out[1] = out[2] = 0;
  for (let i = 0; i < 4; i++) if (w[i] > 0.001) { bandCol(i, f, gloss, t); for (let k = 0; k < 3; k++) out[k] += t[k] * w[i]; }
  for (let k = 0; k < 3; k++) out[k] *= 0.9 + 0.2 * gloss;
}
// sd = (f - nearestThreshold) / |grad f|  (world units to the seam), res = px per unit
function shadePixel(rgb, sd, res, grain) {
  const a = Math.abs(sd);
  if (a < 6) { const e = 1 - a / 6, k = e * e * 0.22; rgb[0] += (255 - rgb[0]) * k; rgb[1] += (240 - rgb[1]) * k; rgb[2] += (215 - rgb[2]) * k; }
  rgb[0] += grain; rgb[1] += grain * 0.9; rgb[2] += grain * 0.8;
  const l = (0.36 - a) * res + 0.5;
  if (l > 0) { const t = Math.min(1, l) * 0.85; rgb[0] += (22 - rgb[0]) * t; rgb[1] += (8 - rgb[1]) * t; rgb[2] += (28 - rgb[2]) * t; }
}

Adapting it to your project

Performance notes

Copy-paste prompt

Use the Shadow Theatre art style for my project: backlit paper shadow-puppet theatre in the Lotte Reiniger tradition.
- The FLOOR is the light: huge organic glowing colour fields from one domain-warped noise value, thresholds -0.95/-0.3/0.35
  → moon teal #76ccc6 | dusk violet #b682dc | crimson #f26a52 | amber #ffc662 (edge colours #2c748c/#6840a2/#b02a42/#ea7a2c, amber gets a hot #fff0c4 heart).
- Seams between fields: thin ink line #16081c (0.72 world units) with light bleeding 6 units out of it; paper grain over everything.
- Ink lace on the floor at 80 % opacity: beads/rings/leaf pairs along seams, grass tufts on amber, filigree scrolls on crimson, leaves and stars on violet, broken ripple rings on teal.
- EVERYTHING standing is a flat silhouette in #0b0510, no outlines, no shading, built from tapered limbs, lens leaves and spiral curls; every tip ends in a curl.
- Only colour on silhouettes is emissive: the main character's carved pumpkin face (#fffbe2→#ffd65e→#ff6a10 with bloom), small creatures' acid-green eyes #d8ff62, large creatures' magenta cracks #ff5ad2. Carve mouths with destination-out.
- Ghost creatures invert: pale blue-white veil with a dark blurred halo under a light blurred halo.
- The main character always has a warm #ffb24a rim (8 tinted offset stamps, blurred, drawn with 'lighter') and an additive follow-spot pool; creatures get a cream rim only during an impact flash.
- Each creature class = unique outline feature + one emissive colour, so a crowd of 200 stays readable.
- Props are ink silhouettes too: curly-tipped trees with a light-through knothole, spear-tipped iron gates, graves, scarecrows, lantern poles and lit gourd lanterns with glowing panes.
- Effects are light (additive flares, sparks, embers, glowing seed trails) or paper (torn shards with glowing #ff9a3a edges, ink scraps).
- Motion like rod puppets: jointed limb swings, whole-sprite rocking, creatures rise from stage slots on a rod.
- Frame: vignette, velvet curtains, scalloped valance with tassels, stage lip. HUD = ink plates with gold hairline rings, glowing gradient bars, Cinzel numbers, IM Fell English SC labels, Cormorant Garamond body.
- Bake all sprites/rims/glows once at ~1.3 × screen px per world unit; per frame only blit.