How Color Memory scores your colors (and why it doesn't use HSL)

In Color Memory you see a color for four seconds and then rebuild it from memory with three sliders: hue, saturation and lightness. The obvious way to score that would be to compare your slider values with the target's. We tried to avoid that approach, because it punishes differences you cannot see and rewards ones you can. This article explains what the game does instead.

The problem with comparing sliders

HSL is convenient for building a color picker, but equal steps do not look equal. A 10 degree hue change on a vivid color is a clear shift. On a nearly grey color the same change is almost invisible, because a grey looks grey whatever its hue. The same happens close to black and white, where hue and saturation barely matter at all. A score based on raw slider distance would treat all of these cases the same, which feels unfair to the player.

Measuring what the eye sees: CIELAB and Delta E

CIELAB (often written Lab) is a color space designed so that the distance between two colors roughly follows how different they look. It has three axes: L for lightness, a for the green to red direction and b for the blue to yellow direction. Color Memory converts both colors in several steps: HSL to sRGB, then to linear light, then to XYZ using a D65 white point, and finally to Lab.

The difference between the two colors, called Delta E, is the straight-line distance between them in Lab: the square root of the squared differences in L, a and b. This is the original 1976 formula, known as CIE76. Newer formulas such as CIEDE2000 are more accurate in some regions of the color space, but they are far more complex. CIE76 is simple and fast enough to recalculate on every guess, and for a game it is accurate enough. A Delta E of roughly 2 to 3 is often quoted as the smallest difference most people can notice when two colors are side by side.

From distance to points

Each color is worth up to 1,000 points, calculated as 1,000 multiplied by e raised to the power of minus Delta E divided by 30, then rounded. Some examples:

  • Delta E 0 (identical): 1,000 points
  • Delta E 3: about 905 points
  • Delta E 10: about 717 points
  • Delta E 16: about 587 points
  • Delta E 30: about 368 points
  • Delta E 60: about 135 points

We use an exponential curve instead of a straight line so that the score falls smoothly. A small slip costs little, a big miss still earns something and there is no cliff where you suddenly drop to zero. The score never reaches exactly zero.

What counts as correct

A guess with a Delta E of 10 or less counts as a hit and as a correct answer on the results screen. The verdict shown after each color uses the same unit: under 3 is a perfect match, under 8 is excellent, under 16 is close, under 30 is off and anything above is way off. Because the thresholds are measured in perceived difference, "close" means roughly the same visual distance whichever color you were given.

What the math means for your strategy

  • Muted colors are forgiving in hue. When saturation is low, a hue change moves the color very little in Lab, so for greys and pastels it is more important to get lightness and saturation right.
  • Vivid colors are the opposite. A few degrees of hue can cost real points when the color is strongly saturated.
  • Every guess starts from the same middle position (hue 180, saturation 50, lightness 50), so nobody gets a head start from the slider position.

The best way to train your eye is to play a few rounds and compare the target with your guess side by side on the reveal screen. The HSL values are shown there as well.

Play Color Memory

← All articles