Teaching an algorithm Sanzo Wada's eye
The colors were easy. Teaching the metric how Wada combines them took five tries.
The colours were easy. Teaching the metric how Wada combines them took five tries.
I set out to generate palettes in the spirit of A Dictionary of Color Combinations. The colours were easy. Learning how Wada combines them took five tries — and each failure taught me I was measuring the wrong thing.
The real story is the metric
The palettes only improved because my yardstick did. Here's how it evolved.
Harmony score
Density of each pair's relationships among his combos.
Diversity volume
Spread = the volume the colours span.
Contrast number
Hit Wada's measured ΔE, ≈0.28.
Value vs chroma
Split contrast into value and saturation.
Learned quality vector
A tuned vector of Wada-ness; sample, don't maximise.
The first sampler ranked colours by a learned harmony and chose with MMR. Before leaning on it, I ran a simple test: show the score one real Wada combination and one random pairing of his colours — can it tell which is real? A perfect judge is right 100% of the time; a useless one, 50% — a coin flip.
Harmony scored a coin flip. Another way to see it: plot the scores it gives to real combinations versus random pairings. A good metric pulls them apart; harmony piles them on top of each other. The gamut (which colours, not how they're combined) is the signal that actually separates.
real Wada random
the two piles overlap → it can't tell them apart
real Wada random
the piles separate → this one can
MMR is sometimes fine. But it's only as reliable as the score steering it — and that score is a coin flip, so good rolls are luck, not skill.
If I can't score harmony, lean on structure: a Determinantal Point Process, the canonical diverse-subset picker. But my kernel weighted "quality" so hard that the DPP huddled in the dense, muted core of the gamut. Every palette became three mid-tones at the same lightness — flatter than random.
I measured Wada's real contrast (mean ΔE ≈ 0.28) and tuned the kernel to hit it. The number matched; the palettes turned into loud primaries — because a single contrast number doesn't care how you reach it, and the cheapest contrast to buy is raw saturation.
Act IV · the diagnosis
I stopped tuning and looked. The plot made the distinction I had been collapsing visible: contrast from lighter and darker colours is different from contrast bought with saturation. I needed the sampler to notice which kind it was producing.
My isotropic kernel treated both directions the same, so it happily traded value for the saturation it should have left alone. The fix had to make the algorithm see colour the way the cloud is shaped.
The gamut, and why it matters
Plot all 159 colours by lightness and saturation. They hug the left — low chroma — at every lightness. That muted band is the gamut. The whole job is: stay in the band, but travel up and down it.
Left, the garish attempt breaks right out of the band into saturation. Right, the final sampler stays in the band and spreads top-to-bottom — contrast from value, exactly like Wada.
The anisotropy is real — but baking it into a bespoke distance metric had a side-effect the two-sample test caught: it skewed palettes warm and clustered their hues. The cleaner fix puts the intelligence in the quality: a multidimensional, Optuna-tuned vector of Wada-ness — manifold proximity, value-conditional typicality (so dark colours aren't punished for being dark), mutedness, hue-fit. With that, diversity can be measured plainly (isotropic), and drawing a k-DPP sample instead of the single greedy-best yields the dark tail, the muted chroma, and a naturally graded saturated accent — no hand-tuned metric required.
The whole journey, on one map
The map makes the trade easier to see. A palette can stay muted and still go flat. It can gain contrast by becoming garish. I wanted room between those failures: a wider range of light and dark, with saturation under control.
One more fix underneath
My candidate colours had been blobs jittered off the 159 named points — which sprayed a third of them out past the muted band, into saturation. I replaced it with sampling the gamut region directly.
only 65% land in the muted band — the rest leak right, into saturation
100% in-band, by construction — and more varied
Alternatives considered & discarded
More harmony features
I tried several feature sets, then moved on to a different question. That did not establish that every richer score would overfit.
Modelling dependence directly
I also tried a copula to model how palette features vary together. That is another way to ask what the sampler needs to preserve.
A hard chroma cap
Clipping saturation works but throws away Wada's value–chroma correlation. The learned metric keeps it.
Pure diversity
Drop quality entirely and the picker grabs garish gamut-edge outliers. Quality still has to gate what's allowed in.
Just widen the jitter
Bigger blobs clump harder around the 159 points and leak further out. The gamut region is the principled fix.
Did I actually become Wada?
Matching a few averages is not the same as matching the distribution. I used a classifier to compare generated palettes with real Wada combinations on summary features in OKLab. That comparison can expose differences in the chosen features. It does not certify that a generator has learned Wada’s taste.
The failures I was trying to correct were visible in the palettes: too much warmth, clustered hues, washed-out colours. I changed how quality was scored and how palettes were sampled, then checked what those changes actually produced.
In each pair below, the book is on top and a saved sample from my generator is underneath.
| feature | Wada | before | after |
|---|---|---|---|
| warm balance (frac warm) | 0.52 | 0.65 | 0.57 |
| hue spread | 0.40 | 0.15 | 0.40 |
| chroma (saturation) | 0.10 | 0.08 | 0.10 |
| saturated accent (chroma range) | 0.10 | 0.07 | 0.10 |
| dark reach (min L) | 0.45 | 0.51 | 0.44 |
The summaries gave me things to inspect. The palettes still had to work.
What I can claim from this
I kept the k-DPP sampler because it gave me useful controls. That is a reason to use it, not a claim that another generator couldn’t do better.
I need to correct the comparison that used to sit here. Its cached summaries conflict, and the AUC/novelty table was hardcoded in the presentation builder. I couldn’t connect those entries to reproducible runs. I’ve removed the ranking and the claim of a ceiling on novel generation. This comparison didn’t establish either.
The next comparison needs a recorded run, with the method, data, and result kept together.
Where we landed
These are 14 saved samples from the generator. Choose a starting hue to inspect the palette generated around it, with that colour forced in. Beside it is the closest real combination from the book, selected by its nearest colour. The wheel displays these examples; it does not run the sampler in your browser.
a hue