Help with guessing game

So, I made a color guessing game but I’m working on the game points.
So, I tried to make a system of it like point can only be 10 to 0 with decimals, but how do you calculate the color accuracy, cause I I’m stumped figuring out how does this work?

here’s the project

Snap! Guess the color

I’d love to help but I can’t understand your code. :~( I don’t understand why you need to clone the UI sprite, I don’t understand why you want to use Javascript, and I can’t figure out how to play the game.

If you’re looking for a measure of accuracy of a color, get the three-item list of RGB, subtract each item from the correct color’s same item, take the absolute values of the three differences, and add them. A perfect match will score 0. The worst possible score would be if the correct color is 255,255,255 and the user said 0,0,0, so the error is 3×255=765. So divide it by 76.5 and that’s your 0 to 10 score.

But maybe it’d be more sensible to cap the error so that all wildly off values count the same. So for each of R,G,B error take MIN(error, 50) or something.

the game is not ready yet, I want to use JavaScript for effects only able with JavaScript like cursors and, i clone the UI sprite to make the start menu of the game.

thats not how you compare colors. there is an algorithm for it.
D = SQRT((R1-R2)^2 + (G1-G2)^2 + (B1-B2)^2)

Yeah I guess.

i WAS about to say “oh it can’t be that hard” but i think i got flashbanged by your game not going to lie