Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix calculateColor function #1121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

konradrydzak
Copy link

@konradrydzak konradrydzak commented Apr 19, 2023

Fix sorting co2Scale to not be in place, change finding scaleIndex to be equal to closestNum (not greater than).

Previously co2Scale was sorted in place and scaleIndex was taken for a value greater than closestNum (if one existed, otherwise it would return -1).
After the changes, scaleIndex should correctly get the exact index of the closestNum value in co2Scale.

Probably also requires the same changes to Web-Dev-For-Beginners/5-browser-extension/solution/ and Web-Dev-For-Beginners/5-browser-extension/3-background-tasks-and-performance/translations/.

Fix sorting co2Scale to not be in place, change finding scaleIndex to be equal to closestNum (not greater than).
@github-actions
Copy link

This PR has not seen any action for a while! Closing for now, but it can be reopened at a later date.

@abrilurena
Copy link
Contributor

looks awesome! thanks @konradrydzak

I'm adding @saragibby here ♥️

@abrilurena abrilurena requested a review from saragibby November 15, 2023 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants