Commit 53df27e4 authored by iamkun's avatar iamkun Committed by hetech

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

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

* Update color.js

* Update color.js
parent ea55f525
...@@ -249,6 +249,7 @@ export default class Color { ...@@ -249,6 +249,7 @@ export default class Color {
} }
} else if (value.indexOf('#') !== -1) { } else if (value.indexOf('#') !== -1) {
const hex = value.replace('#', '').trim(); const hex = value.replace('#', '').trim();
if (!/^(?:[0-9a-fA-F]{3}){1,2}$/.test(hex)) return;
let r, g, b; let r, g, b;
if (hex.length === 3) { if (hex.length === 3) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment