Skip to content

Commit

Permalink
fix(color-picker): fix color-picker can't select 8-digit hex color (E…
Browse files Browse the repository at this point in the history
  • Loading branch information
UxieVerity authored and hzsrc committed Feb 2, 2023
1 parent 00bc3da commit 0922c13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/color-picker/src/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +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;
if (!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(hex)) return;
let r, g, b;

if (hex.length === 3) {
Expand Down

0 comments on commit 0922c13

Please sign in to comment.