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

tinycolor edge case #10

Open
yuqianma opened this issue Jan 23, 2019 · 0 comments
Open

tinycolor edge case #10

yuqianma opened this issue Jan 23, 2019 · 0 comments

Comments

@yuqianma
Copy link

Try #002675 in https://ant.design/docs/spec/colors-cn#%E8%89%B2%E6%9D%BF%E7%94%9F%E6%88%90%E5%B7%A5%E5%85%B7

color-9 is outstanding here.

I found it is due to a tinycolor's feature:
Tinycolor will convert number 0-1 to 0% - 100%

https://github.com/bgrins/TinyColor/blob/96592a5cacdbf4d4d16cd7d39d4d6dd28da9bd5f/tinycolor.js#L327

And value 1 runs into 100% right here.

We can certainly limit the value from 1 to 100 and 0. But how about use other lib like d3-hsv?
Its s and v are simply within 0-1. (But no boundary check...)

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

No branches or pull requests

1 participant