Open yuqianma opened 5 years ago
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
#002675
color-9 is outstanding here.
color-9
I found it is due to a tinycolor's feature: Tinycolor will convert number 0-1 to 0% - 100%
0-1
0% - 100%
https://github.com/bgrins/TinyColor/blob/96592a5cacdbf4d4d16cd7d39d4d6dd28da9bd5f/tinycolor.js#L327
And value 1 runs into 100% right here.
1
100%
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...)
s
v
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%B7color-9
is outstanding here.I found it is due to a tinycolor's feature: Tinycolor will convert number
0-1
to0% - 100%
https://github.com/bgrins/TinyColor/blob/96592a5cacdbf4d4d16cd7d39d4d6dd28da9bd5f/tinycolor.js#L327
And value
1
runs into100%
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
andv
are simply within0-1
. (But no boundary check...)