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

[COLORPICKER] ,在渐变色css中输入linear-gradient(157.67deg, #49D7FE 66.11%, #1F7EC1 86.54%),不支持 #2304

Open
mysllove opened this issue Jun 22, 2023 · 8 comments
Labels
🐞 bug Something isn't working example Something about example to be published fixed, not be published

Comments

@mysllove
Copy link

tdesign-react 版本

最新版出现

重现链接

No response

重现步骤

No response

期望结果

No response

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

👋 @mysllove,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@Summer-Shen
Copy link
Contributor

试了一下,现在的效果如下:

colorpicker-linear-gradient-example

请问是否已经解决了?

@uyarn
Copy link
Collaborator

uyarn commented Nov 25, 2023

没有呢

@Summer-Shen
Copy link
Contributor

请问 linear-gradient 的角度参数需要允许小数吗?

@mysllove
Copy link
Author

👋 @Summer-Shen ,颜色明显不对
image
分别用单色和渐变的css输入linear-gradient(157.67deg, #49D7FE 66.11%, #1F7EC1 86.54%),单色的会跳转渐变颜色没问题,渐变的css就不对

@mysllove
Copy link
Author

@HaixingOoO

@HaixingOoO
Copy link
Collaborator

@mysllove 好的,我后续修复一下,感谢。

@HaixingOoO HaixingOoO added the 🐞 bug Something isn't working label Nov 29, 2023
@huangchen1031
Copy link
Contributor

在css输入渐变字符串时并没有经过特殊处理,linear-gradient(157deg,rgba(73, 215, 254, 1) 66.11%,rgb(31, 126, 193) 86.54%)这种格式能被识别是因为tinyColor在正则匹配处理输入的时候恰好能识别到第一个rgba

当使用linear-gradient(157.67deg, #49D7FE 66.11%, #1F7EC1 86.54%)作为输入时,并不能正确识别到hex6,因为正则写的是:

 hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,

于是返回了默认值。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working example Something about example to be published fixed, not be published
Projects
None yet
Development

No branches or pull requests

5 participants