ColorPicker: Fix handle error hex color string (#14793)

* fix(ColorPicker): Fix handle error hex color string

* Update color.js

* Update color.js
This commit is contained in:
iamkun
2019-03-27 17:48:58 +08:00
committed by hetech
parent ea55f525a1
commit 53df27e48f

View File

@@ -249,6 +249,7 @@ export default class Color {
}
} else if (value.indexOf('#') !== -1) {
const hex = value.replace('#', '').trim();
if (!/^(?:[0-9a-fA-F]{3}){1,2}$/.test(hex)) return;
let r, g, b;
if (hex.length === 3) {