提交 401c4064 编写于 作者: W wangyaqi

fix: 修复hex颜色值为3位时转换错误的bug

上级 1b29984b
...@@ -7,6 +7,10 @@ export function hexToRgba (hex) { ...@@ -7,6 +7,10 @@ export function hexToRgba (hex) {
r = hex.substring(0, 2) r = hex.substring(0, 2)
g = hex.substring(2, 4) g = hex.substring(2, 4)
b = hex.substring(4, 6) b = hex.substring(4, 6)
} else if (hex.length === 3) {
r = hex.substring(0, 1)
g = hex.substring(1, 2)
b = hex.substring(2, 3)
} else { } else {
return false return false
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册