Skip to content

Commit

Permalink
Merge pull request #5 from leedave/feature/color_guess_dev2
Browse files Browse the repository at this point in the history
Color Distance meter working
  • Loading branch information
leedave authored Feb 14, 2023
2 parents a2d1699 + 1dc4b09 commit e5474c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Games/color_guess/views/color_guess_play.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void color_guess_play_calculate_closeness(void* context, ColorGuessPlayModel* mo
int distanceRed = abs(ledRed - userRed);
int distanceGreen = abs(ledGreen - userGreen);
int distanceBlue = abs(ledBlue - userBlue);
float percentageRed = 100 - ((distanceRed / 255.0) * 100);
float percentageRed = 100 - ((distanceRed / 255.0) * 100); //make sure one number is float, otherwise C will calc wrong
float percentageGreen = 100 - ((distanceGreen / 255.0) * 100);
float percentageBlue = 100 - ((distanceBlue / 255.0) * 100);
float fullPercentage = (percentageRed + percentageGreen + percentageBlue) / 3;
Expand Down

0 comments on commit e5474c9

Please sign in to comment.