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

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

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