/**
 * Background: paper-noise.
 *
 * Editorial-warm uses this. Subtle warm tint via a single large soft-
 * edged ellipse in one corner — gives the slide a "this is paper" feel
 * without needing real raster noise (which would inflate the deck).
 *
 * Cheap to render, works everywhere, reads as "this slide is paper."
 */
import { SLIDE_DIMENSIONS } from '../grid.js';
import { shade } from '../palettes.js';

export default function applyNoise(slide, resolved) {
  slide.background = { color: resolved.palette.bg };

  // A faint warm vignette in the top-right corner — implies natural
  // paper texture without requiring an embedded image.
  const tint = shade(resolved.palette.bg, -6);
  slide.addShape('ellipse', {
    x: SLIDE_DIMENSIONS.width * 0.55,
    y: -SLIDE_DIMENSIONS.height * 0.4,
    w: SLIDE_DIMENSIONS.width * 1.0,
    h: SLIDE_DIMENSIONS.height * 1.2,
    fill: { color: tint, transparency: 60 },
    line: { type: 'none' },
  });
}
