color-js/color.js

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

Closed this issue · 0 comments

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.