Urgent.News

What's breaking now, across thousands of outlets.

Tech

Delta E is a distance, not a score

I run a game where you get a brand name — Spotify, IKEA, Home Depot — and rebuild its primary color from memory with three sliders: hue, saturation, lightness. On submit, the guess and the target both go to CIE Lab and the score comes from the distance between them. The scoring line was this: const score = Math . max ( 0 , 100 - deltaE * 2 ); It looks defensible. ΔE around 2 is the classic…

Delta E is a measure of color difference, not a score. The scoring system in a game involved calculating the distance between a player's guess and the target color in CIE Lab space, then using that value to assign a score based on a formula. The formula, score = Math.max(0, 100 - deltaE * 2), suggested that a ΔE of 2 indicated a just-noticeable difference between colors, and a ΔE of 50 meant the colors were not the same.

However, the implementation was flawed because it did not accurately reflect the real distribution of player guesses. The scoring formula resulted in an average ΔE of around 37, which is considered a normal human guess. The formula stopped conveying meaningful information for more than a quarter of the inputs, as badly-off and hopelessly-off guesses were assigned the same score.

The issue was that the range of the curve did not match the range of actual player performance. The fix was to adjust the maximum ΔE value to 90 and introduce a curve exponent to better represent player performance. After the correction, the average score increased from 35.7 to 68.4, and the distribution of scores became more accurate.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I Built a Retry Library Because I Kept Losing Failed API Calls

Every retry library I found did the same thing: wrap a function, retry it a few times, throw if it still fails. Fine until the retries run out and the error just... disappears into a catch block.

  • Developer created smart-retry library to improve existing API call retry solutions
  • Offers drop-in Axios and Fetch clients, automatic failure logging, and replay capability
  • Customizable conditions via shouldRetry callback, defaults to retrying specific errors

More from Monday 31 August →