Solving Colordle in Four Guesses

Colordle is a color-guessing game. A secret color is chosen from a database of 29,979 named colors. You guess colors. After each guess, the game tells you how close you were — a score from 0 to 100. Before reading further, go play a few rounds — it builds intuition for what follows.

If you precompute a table of every color's score against a few fixed probes, you can look up the answer with a KD-tree instantly. That gives you 100%. But you've just memorized the database. The game becomes trivial. Not interesting.

The question that kept us going: what can you figure out honestly? No database. Just the public distance formula and a few measurements.

Here is what a game looks like.

Each score is a distance measurement: score = 100 − distance. Three distances from three known points in a 3D space. That sounds like enough to pin down a location.

It almost is.


30,000 Colors in a Room

Colors live in CIELAB space — a 3D coordinate system where L is lightness (0 = black, 100 = white), a is the green–red axis, and b is the blue–yellow axis. Below is a sample of the 29,979 database colors, plotted at their true coordinates and rendered in their actual color.

Step through each probe guess and watch the candidate set shrink.

29,979colors it could be

After one probe, the secret could be any of 486 colors — all sitting at the same perceptual distance from the first guess. After two probes, just 12. After three, only 2 candidates remain.

Two. Not one. We will come back to this.


The Distance Function

The game's creator chose CIEDE2000 — a perceptual distance metric, engineered over decades to match how humans actually see color difference. Euclidean distance in LAB is simple but wrong: two colors can be far apart numerically yet look identical, or close numerically yet obviously different.

CIEDE2000 corrects for this with position-dependent weighting. It operates in chromahue–lightness coordinates rather than raw cartesian LAB. The full formula, for two colors \((L_1, a_1, b_1)\) and \((L_2, a_2, b_2)\):

$$\Delta E_{00} = \sqrt{ \left(\frac{\Delta L'}{S_L}\right)^2 + \left(\frac{\Delta C'}{S_C}\right)^2 + \left(\frac{\Delta H'}{S_H}\right)^2 + R_T \frac{\Delta C'}{S_C}\frac{\Delta H'}{S_H} }$$

where \(\Delta L'\), \(\Delta C'\), \(\Delta H'\) are differences in lightness, chroma, and hue — but in modified coordinates that depend on both colors. The weighting functions \(S_L\), \(S_C\), \(S_H\) vary with position: lightness is weighted differently near black than near white, hue matters more at high saturation. \(R_T\) is a rotation correction that kicks in for blue hues, involving a Gaussian and an arctangent.

If you want to understand what it means to modify the Pythagorean theorem like this — to have a distance function that warps depending on where you are in the space (a Riemannian manifold) — this video about metric tensors is a beautiful introduction.

Below: the ratio of CIEDE2000 to Euclidean distance across the a*–b* plane at L*=50, with neutral gray at center.

The ratio varies from 0.62 to 0.99 — nearly a 40% warp. A "sphere" of equal CIEDE2000 distance is a warped blob in LAB coordinates. Any solver needs to account for this.


Method A & B: Learn the Shape of the Space

The first approaches: learn a small model of the curvature, then do standard trilateration in the corrected space. Both train on random LAB pairs using the public CIEDE2000 formula — no database.

Method A. Metric Tensor (36 parameters)

At any point in color space, distance can be locally approximated by a metric tensor — a 3×3 matrix that says how much each direction costs:

$$d(a, b) \approx \sqrt{(a-b)^T \cdot G(\text{midpoint}) \cdot (a-b)}$$

We model \(G\) as varying linearly with position: four symmetric 3×3 matrices, 36 parameters total.

Method B. Learned Embedding (115 parameters)

Alternatively, learn a small neural network that flattens the curved space — map LAB to a new 3D space where Euclidean distance approximates CIEDE2000:

def embed(lab):
    h = lab @ W1 + b1     # (3) → (16)
    h = relu(h)            # nonlinearity
    return h @ W2 + b2     # (16) → (3)

115 parameters. In this flattened space, trilateration works better. With 4 probes (5 guesses total), both methods reach 100%. With 3 probes (4 guesses), about 67%.

Respectable. But the models are learning an approximation of the distance function, then trilaterating in the approximate space. What if we used the exact formula instead?


Method C: Just Solve the Equations

We know the CIEDE2000 formula. We know the three probe positions. After probing, we have three numbers. So we can write down the system directly:

$$\Delta E_{00}(p_1, x) = d_1, \quad \Delta E_{00}(p_2, x) = d_2, \quad \Delta E_{00}(p_3, x) = d_3$$

Three equations, three unknowns \((L, a, b)\). No approximation. No learned parameters. Just hand the exact equations to a numerical root-finder and let it converge.

This works. scipy.optimize.least_squares converges in about 10 iterations, with residuals below \(10^{-28}\). Zero learnable parameters. 63% win rate.

Wait — only 63%? The solver converges perfectly every time. Every solution it finds satisfies all three equations exactly. So why does it get the wrong color 37% of the time?

The Two-Solution Problem

Because three distance equations in three dimensions don't have one solution. They have two. This is the fundamental geometry of trilateration.

ProbesConstraint geometryDegrees of freedom
0All of 3D space3
1A surface (warped sphere)2
2A curve (sphere intersection)1
3Two points0 + 1 bit of ambiguity

Two spheres intersect in a circle. A third sphere cuts that circle at two points. This is basic geometry — and it's the same reason GPS needs four satellites, not three. The fourth breaks the Earth-surface/outer-space ambiguity.

We confirmed this isn't a CIEDE2000 quirk by running the same experiment with plain Euclidean distance:

Metric1 solution2 solutions3+Honest win rate
Euclidean46%54%0%75%
CIEDE200032%59%9%58%

Same two-point ambiguity. The warped metric was never the bottleneck. The bottleneck is the geometry of three spheres in three dimensions.


Information Theory

To identify one color among 29,979, we need:

$$H(\text{secret}) = \log_2(29{,}979) = 14.87 \text{ bits}$$

Each distance measurement returns a score with 0.01 precision across a ~100-point range — up to \(\log_2(10{,}000) \approx 13.3\) bits per guess. How much of that is new information?

Probes usedCumulative infoNew infoCandidates left
1st probe12.77 bits (85.9%)12.77 bits486
2nd probe14.87 bits (99.99%)2.10 bits12
3rd probe14.87 bits (100%)0.002 bits2

The first probe does most of the work. The third adds a mere 0.002 bits — but those bits narrow 12 candidates down to 2.

The score triples \((s_1, s_2, s_3)\) are unique for all 29,979 colors. The information is there. But having 14.87 bits encoded in three numbers is not the same as being able to decode them without a lookup table. The two-solution degeneracy means that without consulting the database, you cannot extract the last bit.


Where Things Stand

StrategyGuessesParamsWin %Honest?
Score-table lookup (KD-tree)360K floats100%No — memorizes DB
Method C + DB disambiguation4097.6%No — uses DB to pick basin
AMetric tensor (4 probes)536100%Yes, but 5 guesses
BLearned embedding (3 probes)411567%Yes
C Numerical inversion (3 probes) 40~63% Yes

"Honest" = no database access except one final snap-to-nearest-color. Training uses random LAB samples + the public CIEDE2000 formula only.

Method C — zero parameters, just the formula and a root-finder — matches the learned approaches. All three honest methods hit the same ceiling. The gap between ~65% and 100% is not algorithmic headroom. It is the two-solution degeneracy: a geometric fact about three distance equations in three dimensions.


Appendix: How Discovery Actually Happened

The storytelling above was linear. The actual process was not.

We started with neural networks — autoregressors, embeddings, residual corrections, Fourier features. All of them achieved 0% win rate when trained honestly. We tried distillation from the database, which worked but was cheating. We tried 2-probe approaches and spent days wondering why they failed, before realizing that two distances in three dimensions is fundamentally underdetermined.

The breakthrough came from asking: what if we skip the neural network entirely and just solve the equations numerically? That gave us 63% immediately — better than any learned model — and the failure analysis revealed the two-solution degeneracy, which turned out to be the same geometric fact that makes GPS need four satellites.

The Euclidean control experiment was the final piece. Swap CIEDE2000 for plain Euclidean distance and you get the same two solutions. The warped metric was never the problem. The problem was always the geometry.

I feel confident that Colordle has no honest strategy that can guarantee a solve by the fourth guess.

Built with Three.js, Plotly, and KaTeX. Data from 29,979 colors in CIELAB space.