Skip to content
New issue

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

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

Already on GitHub? # to your account

Incorrect Array size in score.ts #46

Closed
avanisubbiah opened this issue Jul 29, 2022 · 1 comment
Closed

Incorrect Array size in score.ts #46

avanisubbiah opened this issue Jul 29, 2022 · 1 comment
Labels
bug Something isn't working library: typescript

Comments

@avanisubbiah
Copy link

Line 67 of score.ts has the line const hueProportions = new Array<number>(360).fill(0); to allocate an array of size 360 to cache proportions of hues. Hues can range up to 360 so the size should be 361 or else the highest index available is 359 and caching a hue of 360 will have the array auto-grow to accommodate.

@guidezpl guidezpl added bug Something isn't working library: typescript labels Feb 9, 2023
kwaa added a commit to importantimport/material-color-utilities that referenced this issue Mar 2, 2023
@pennzht
Copy link
Collaborator

pennzht commented Jun 21, 2023

Fixed at 804c95f#diff-708c6e32eb90786521ae647ad19adfdf7c63a98c1dc8cdb2b39f5c9628b3a05a

Now we use floor, so the highest hue (say 359.9999) would floor to 359.

@pennzht pennzht closed this as completed Jun 21, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working library: typescript
Projects
None yet
Development

No branches or pull requests

3 participants