What’s on screen

Brown chromatophores sit over about a third of the cells and open in travelling waves.

Yellow cells swell and shift from olive to gold in slow-moving groups, which is where the painterly look comes from.

Red dots are scattered between them, pulsing on their own clocks.

The background is a blue-teal gradient with a pale band, covered in thousands of flickering sparkles that stay put while the cells drift over them.

squid skin by Robert Stansfield
Macro photograph of squid skin by Robert Stansfield

Dark brown chromatophores clostered over smaller  yellow cells and tiny red dots, on an iridescent blue background.

How it got here

Ten versions so far. Most of them were wrong in instructive ways.

Click or drag to trigger expansion waves

Octopus-skin

Oscillators drift, synchronize, and modulate color by phase

 

Tech Stack: p5.js

sync-engine.js
// ⏳ 1. STEPPING THE TIMELINE FORWARD
// Every frame, each point steadily builds up its internal timer
p.phase += p.freq;

// ⚡ 2. THE FLASH & TRIGGER EVENT
// When a point reaches full charge, it resets and signals a flash
if (p.phase >= 1) {
  p.phase = 0;
  p.flash = 1;  // Instantly jump to max brightness

  // 🌐 3. SPREADING THE SIGNAL TO NEIGHBORS
  // Check all other points; if they are close enough, nudge them closer to flashing
  for (let q of points) {
    if (p === q) continue;
    let d = dist(p.x, p.y, q.x, q.y);
    
    if (d < couplingRadius) {
      q.phase += couplingStrength; // Give the neighbor a phase boost
      if (q.phase >= 1) q.phase = 0;
    }
  }
}

// 📉 4. THE GLOW FADE EFFECT
// Smoothly decay the brightness over time so it behaves like a pulse
p.flash *= 0.90;
Share