Open ximex opened 5 months ago
add a type for hex-color strings that is a bit stricter than only string. type HexColor = `#${string}`;
string
type HexColor = `#${string}`;
@ximex I can add this type to the package. I tried using the HexColor type, but it may not be easy to use in the code because many places have done error handling, which causes type errors.
HexColor
https://github.com/uiwjs/react-color/blob/632d4e9201e26b42ee7d5bfeda407144e9a6e2f3/packages/color-convert/src/index.ts#L335-L336
https://github.com/uiwjs/react-color/blob/632d4e9201e26b42ee7d5bfeda407144e9a6e2f3/packages/color-convert/src/index.ts#L339
add a type for hex-color strings that is a bit stricter than only
string
.type HexColor = `#${string}`;