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

Color.js typing for Coords is number even though functions may return null #527

Closed
KeyboardDanni opened this issue May 26, 2024 · 0 comments · Fixed by #530
Closed

Color.js typing for Coords is number even though functions may return null #527

KeyboardDanni opened this issue May 26, 2024 · 0 comments · Fixed by #530
Assignees
Labels
Milestone

Comments

@KeyboardDanni
Copy link

Related to #409

The typing for Coords seems to be out of date:

export type Coords = [number, number, number];

Since NaN has been replaced with null, there is no longer a guarantee that the values coming back will be number. Was getting a runtime error with the latest git when my color sliders tried to call toString() on the color values, but one of them ended up being null. I was confused at first because TypeScript didn't complain about the typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants