-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
28 lines (27 loc) · 889 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict'
module.exports = {
hex: {
strict: /^#([a-f0-9]{6}|[a-f0-9]{3})\b$/,
global: /#([a-f0-9]{6}|[a-f0-9]{3})\b/gi
},
hexa: {
strict: /^#([a-f0-9]{8}|[a-f0-9]{4})\b$/,
global: /#([a-f0-9]{8}|[a-f0-9]{4})\b/gi
},
rgb: {
strict: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
global: /rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)/gi
},
rgba: {
strict: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*(?:\.\d+)?)\)$/,
global: /rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*(?:\.\d+)?)\)/gi
},
hsl: {
strict: /^hsl\(\s*(\d+)\s*,\s*(\d*(?:\.\d+)?%)\s*,\s*(\d*(?:\.\d+)?%)\)$/,
global: /hsl\(\s*(\d+)\s*,\s*(\d*(?:\.\d+)?%)\s*,\s*(\d*(?:\.\d+)?%)\)/gi
},
hsla: {
strict: /^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/,
global: /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)/gi
}
}