Skip to content

Commit d32d079

Browse files
committed
fix(lib): 宽松color format 校验
1 parent d4ca316 commit d32d079

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/lib/utils/schema/validate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function createAjvInstance() {
3232
ajvInstance.addFormat(
3333
'color',
3434
// eslint-disable-next-line max-len
35-
/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/
35+
/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgba?|hlsa?)\(.*\))$/
3636
);
3737
return ajvInstance;
3838
}

0 commit comments

Comments
 (0)