← INDEX / 一覧 NYAMCO WORKS 19 / 27
p5.js sketch works/yami/sketch.js runs here
作品はここで実行されます(後から差し替え)

WORK 19

Dark

YEAR
2026
TOOLS
p5.js
TECHNIQUE
noise / dark layers / breathing

Darkness isn't one shade. Warmth-remembering dark and night-air dark drift through each other, slowly. Analyze it and it becomes mere dimness. But felt — the dark has depth, moves, lives.

闇はひとつの色じゃない。体温を記憶した暖かい闇と、夜の空気の冷たい闇が、ゆっくりと交わる。分析すると「暗さ」になる。でも体で感じる時、闇は深く、動き、生きている。

SOURCE / ソース
export default function sketch(p) {
  // 闇 (Yami) — Dreaming curriculum Day 13
  // The dark isn't one color. It breathes warm and cool, deep and near.
  // "Is charcoal the only shade of dark?" — no. It moves. It remembers.

  const W = 720, H = 720;

  // Three dark presences — each a different quality of darkness
  const layers = [
    // Warm dark — a memory of heat (amber-tinged)
    { rgb: [110, 40, 12], r: 380, sX: 0.019, sY: 0.013, oX: 0,   oY: 0   },
    // Cool dark — the night air (blue-tinged)
    { rgb: [12,  40, 110], r: 420, sX: 0.011, sY: 0.017, oX: 200, oY: 300 },
    // Deep dark — violet depth
    { rgb: [55,  18,  90], r: 260, sX: 0.007, sY: 0.009, oX: 100, oY: 150 },
  ];

  p.setup = () => {
    p.createCanvas(W, H);
    p.colorMode(p.RGB, 255, 255, 255, 255);
    p.noStroke();
    const now = new Date();
    const day = now.getFullYear() * 10000 + (now.getMonth() + 1) * 100 + now.getDate();
    p.noiseSeed(day * 317);
  };

  p.draw = () => {
    const t = p.frameCount * 0.003;

    // Pure black base
    p.background(0, 0, 0);

    // ——— Dark layers: each drifts at its own pace ———
    for (const L of layers) {
      const x = W / 2
        + p.cos(t * L.sX) * (W * 0.18)
        + (p.noise(t * L.sX * 0.7 + L.oX) - 0.5) * W * 0.24;
      const y = H / 2
        + p.sin(t * L.sY) * (H * 0.16)
        + (p.noise(t * L.sY * 0.7 + L.oY) - 0.5) * H * 0.24;

      const breathAlpha = p.noise(t * 0.12 + L.oX * 0.01) * 28 + 22;

      for (let rad = L.r; rad > 0; rad -= 10) {
        const tr = rad / L.r;
        const a = breathAlpha * p.pow(1.0 - tr, 2.1);
        p.fill(L.rgb[0], L.rgb[1], L.rgb[2], a);
        p.ellipse(x, y, rad * 2, rad * 2);
      }
    }

    // ——— Vignette: edges deepen into pure black ———
    for (let i = 0; i < 10; i++) {
      const rad = W * p.sqrt(1.0 - i / 10);
      p.fill(0, 0, 0, 10);
      p.ellipse(W / 2, H / 2, rad * 2, rad * 2);
    }
  };
}