---
title: "Paint Mixer"
url: "https://sanyam.sh/lab/paint-mixer"
date: "2026-11-23"
---

# Paint Mixer

Tap or drag a pigment into the well, then stir it.

a colour picker that works like a paint well. drop pigments in, stir with the pointer, and the mixture under the ring at the centre is the colour picked.

key insight: paint mixes by kubelka-munk, so each channel is mixed as absorption over scattering and turned back into reflectance. blue and yellow make green, where averaging rgb makes grey.

the well is a real fluid simulation on the gpu, and each texel carries the mixture's `k/s` times its weight, so advection does the mixing and streaks marble before they blend.

- Source: https://github.com/SanyamPunia/www/blob/main/components/labs/paint-mixer/fluid.ts
