🩹 Reset score on new color
This commit is contained in:
@ -117,14 +117,16 @@
|
||||
guessScore = score(targetColor, guessColor);
|
||||
}}
|
||||
/>
|
||||
|
||||
<Button
|
||||
text="New Color"
|
||||
text="New color"
|
||||
emoji="🔄"
|
||||
callback={() => {
|
||||
if (confirm("Generate new color?")) {
|
||||
targetColor = randomRgbColor();
|
||||
guessColor = [0, 0, 0];
|
||||
guessCmykColor = [0, 0, 0, 0];
|
||||
guessScore = undefined;
|
||||
}
|
||||
}}
|
||||
/>
|
||||
@ -162,6 +164,7 @@
|
||||
emoji={realtimeScore ? "⏸️" : "▶️"}
|
||||
callback={() => {
|
||||
realtimeScore = !realtimeScore;
|
||||
if (!realtimeScore) guessScore = undefined;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user