I'll build a mesmerizing reaction-diffusion pattern generator with the Gray-Scott model. Let me start by exploring the project structure.
Now I have a clear picture. Let me build a sophisticated reaction-diffusion generator. I'll use the Gray-Scott model running on a Canvas2D with a typed-array buffer for performance. The UI will be sleek and modern with live controls.
Now let me create the core reaction-diffusion engine using a typed-array double buffer with the Gray-Scott model:
Let me fix the unused variable warning in the engine:
Now let's create the main App component with the canvas rendering, control panel, and the mesmerizing UI:
Let me clean up the unused declarations and use the auto-seed interval state in a working control:
The remaining error is about setAutoSeedInterval not being read. Let me check if it actually got added to the new input — the lint check may be using cached results. Let me read the file to confirm:
It is being used. The lint warning may be a stale cache — let me run the build to verify:
The build succeeded. The reaction-diffusion lab is complete. Here's what I built:
🧪 Reaction-Diffusion Lab
Core engine (src/lib/rd-engine.ts):
- A high-performance Gray-Scott solver with a 9-point weighted Laplacian for smooth, isotropic evolution
- Toroidal (wrap-around) grid that lets patterns grow infinitely without edge artifacts
- Ping-pong double buffers using
Float32Array for stable, fast stepping
- Multiple seeding methods:
inject() for point sources, seedBlobs(), seedCenter(), seedPattern()
Visualization (src/lib/palettes.ts):
- 10 hand-tuned color palettes (Inferno, Abyssal Ocean, Toxic Bloom, Magma, Neon Pulse, Bone, Coral Reef, Matrix, Plasma, Aurora) built from multi-stop RGB interpolation
- Live contrast/brightness controls over the V (chemical B) field
App (src/App.tsx):
- Auto-starts on mount with a beautiful 22-blob seed pattern
- Live F/k controls (feed 0.01–0.08, kill 0.03–0.075) with classic-region presets: Spots, Stripes, Mitosis, Coral, Maze, Fingerprint, Neurons, Solitons, Worms, Chaos — each tuned to well-known Turing-pattern attractors
- Speed multiplier (1×–8× substeps per frame) for accelerated evolution
- Pointer painting — click and drag the canvas to inject new V, watching fresh growth sprout under your cursor
- Auto-inject mode with a configurable timer for ambient periodic perturbations
- Three seed patterns (blobs, center, cross-hatch lines) for different initial conditions
- Sleek glass-morphism control panel with palette swatches that hover to reveal names
- Live status bar with FPS, run-time, and pulse indicator
- Hideable UI for distraction-free viewing
The patterns evolve continuously — try switching from "Spots" to "Mitosis" to "Coral" and watch the topology completely transform as the parameters cross into different Turing-unstable regions.
Files built: index.html, src/index.css, src/lib/rd-engine.ts, src/lib/palettes.ts, src/App.tsx