Spectral.js is a lightweight JavaScript library for realistic pigment mixing, using the Kubelka-Munk theory to simulate how real paints absorb and scatter light.

Unlike typical RGB blending, Spectral.js calculates pigment interactions through spectral reflectance and colorimetric math — including OKLab, OKLCh, and ΔE gamut mapping — for accurate, perceptual mixing.

Selected color
Color 1
1.00

Color 2
1.00

Color 3
1.00




Mixing
Palette
Gradient
Multi-color mixing
Available on GitHub