Code

p5.js

Color & Typography

BeginnerlerpColor() for smooth colour transitions, animated textSize(), textStyle(), textAlign(), and drop-shadow layering. p5.js Docs

// Smooth background transition
const bgA = p.color(20, 20, 60);
const bgB = p.color(60, 10, 40);
p.background(p.lerpColor(bgA, bgB, (Math.sin(t) + 1) / 2));

// Colour swatches
for (let i = 0; i < cols; i++) {
  const c = p.lerpColor(
    p.color(255, 80, 120),
    p.color(80, 200, 255),
    i / (cols - 1),
  );
  p.fill(c);
  p.rect(i * sw, 0, sw, 28);
}

// Animated text
p.textAlign(p.CENTER, p.CENTER);
p.textSize(48 + Math.sin(t * 3) * 8);
p.textStyle(p.BOLD);

// Shadow layer
p.fill(shadowColor);
p.text(word, p.width / 2 + 3, p.height / 2 + 3);

// Foreground layer
p.fill(fgColor);
p.text(word, p.width / 2, p.height / 2);