-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.pom
263 lines (234 loc) · 10.4 KB
/
index.pom
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
let x = [ascii_xdigit];
let decimal_end = ("." ["0"-"9"]+);
let zero_decimal_end = ("." "0"+);
let number = "-"? ["0"-"9"]+ decimal_end?;
let rotation_number_keyword = ("deg" | "rad" | "grad" | "turn");
let eight_bit_number = (
"0"*
# 0.0 - 255.0
range "0"-"254" decimal_end?
|
"255" zero_decimal_end?
|
# .0
decimal_end
);
let zero_one_number = (
"0"*
# 0.0 - 0.99
("0"+)? decimal_end?
|
# 1 1.0
"1" zero_decimal_end?
|
# .0
decimal_end
);
let zero_hundred_number = (
"0"*
(range "0"-"99" decimal_end?)
|
"100" zero_decimal_end?
);
let percentage = (
"0"*
# 0.0% - 100.0%
(
range "0"-"99" decimal_end?
|
"100" zero_decimal_end?
|
# .0
decimal_end
) "%"
);
let alpha_number = percentage | zero_one_number;
let hue_number = number rotation_number_keyword?;
let comma_sep = [s]* "," [s]*;
let slash_sep = [s]* (regex "\\/") [s]*;
(
(
# Hexadecimal
# https://w3c.github.io/csswg-drafts/css-color/#hex-color
:("#") (
# 6 and 8 long
:(x{2}) :(x{2}) :(x{2}) :(x{2})?
|
# 3 and 4 long
:(x) :(x) :(x) :(x)?
)
)
|
(
# RGBA
# https://w3c.github.io/csswg-drafts/css-color/#rgb-functions
# rgb() = [ <legacy-rgb-syntax> | <modern-rgb-syntax> ]
# rgba() = [ <legacy-rgba-syntax> | <modern-rgba-syntax> ]
# <legacy-rgb-syntax> = rgb( <percentage>#{3} , <alpha-value>? ) |
# rgb( <number>#{3} , <alpha-value>? )
# <legacy-rgba-syntax> = rgba( <percentage>#{3} , <alpha-value>? ) |
# rgba( <number>#{3} , <alpha-value>? )
# <modern-rgb-syntax> = rgb(
# [ <number> | <percentage> | none]{3}
# [ / [<alpha-value> | none] ]? )
# <modern-rgba-syntax> = rgba(
# [ <number> | <percentage> | none]{3}
# [ / [<alpha-value> | none] ]? )
:("rgb" | "rgba") "(" (
(
# <legacy-rgb-syntax>
(
[s]* :(eight_bit_number) comma_sep :(eight_bit_number) comma_sep :(eight_bit_number) (comma_sep :(alpha_number))? [s]*
|
[s]* :(eight_bit_number) [s]+ :(eight_bit_number) [s]+ :(eight_bit_number) [s]*
)
|
(
[s]* :(percentage) comma_sep :(percentage) comma_sep :(percentage) (comma_sep :(alpha_number))? [s]*
|
[s]* :(percentage) [s]+ :(percentage) [s]+ :(percentage) [s]*
)
|
# <modern-rgb-syntax>
[s]* :(eight_bit_number) [s]+ :(eight_bit_number) [s]+ :(eight_bit_number) (slash_sep :(alpha_number))? [s]*
|
[s]* :(percentage) [s]+ :(percentage) [s]+ :(percentage) (slash_sep :(alpha_number))? [s]*
)
) ")"
)
|
(
# HSL / HSLA
# https://w3c.github.io/csswg-drafts/css-color/#the-hsl-notation
# hsl() = [ <legacy-hsl-syntax> | <modern-hsl-syntax> ]
# hsla() = [ <legacy-hsla-syntax> | <modern-hsla-syntax> ]
# <modern-hsl-syntax> = hsl(
# [<hue> | none]
# [<percentage> | <number> | none]
# [<percentage> | <number> | none]
# [ / [<alpha-value> | none] ]? )
# <modern-hsla-syntax> = hsla(
# [<hue> | none]
# [<percentage> | <number> | none]
# [<percentage> | <number> | none]
# [ / [<alpha-value> | none] ]? )
# <legacy-hsl-syntax> = hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )
# <legacy-hsla-syntax> = hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )
let hsl_hue = hue_number;
let hsl_saturation = percentage;
let hsl_lightness = percentage;
let hsl_alpha = alpha_number;
:("hsl" | "hsla") "(" (
(
# <modern-hsl-syntax>
[s]* :(hsl_hue) [s]+ :(hsl_saturation) [s]+ :(hsl_lightness) (slash_sep :(hsl_alpha))? [s]*
|
# <legacy-hsl-syntax>
(
[s]* :(hsl_hue) comma_sep :(hsl_saturation) comma_sep :(hsl_lightness) (comma_sep :(hsl_alpha))? [s]*
|
[s]* :(hsl_hue) [s]+ :(hsl_saturation) [s]+ :(hsl_lightness) [s]*
)
)
) ")"
)
|
(
# HWB
# https://w3c.github.io/csswg-drafts/css-color/#the-hwb-notation
# hwb() = hwb( [<hue> | none] [<percentage> | none] [<percentage> | none] [ / [<alpha-value> | none] ]? )
let hwb_hue = hue_number;
let hwb_whiteness = percentage;
let hwb_blackness = percentage;
let hwb_alpha = alpha_number;
:("hwb") "(" (
(
[s]* :(hwb_hue) [s]+ :(hwb_whiteness) [s]+ :(hwb_blackness) ((slash_sep :(hwb_alpha))? [s]*)?
)
) ")"
)
|
(
# LAB / OKLAB
# https://w3c.github.io/csswg-drafts/css-color/#specifying-lab-lch
# lab() = lab( [<percentage> | <number> | none]
# [ <percentage> | <number> | none]
# [ <percentage> | <number> | none]
# [ / [<alpha-value> | none] ]? )
# Percentages: Allowed for L, a and b
# Percent reference range for L: 0% = 0.0, 100% = 100.0
# for a and b: -100% = -125, 100% = 125
let lab_lightness = percentage | zero_hundred_number;
let lab_astar = "-"? (percentage | ((range "0"-"124" decimal_end?) | "125" zero_decimal_end?));
let lab_bstar = lab_astar;
let lab_alpha = alpha_number;
:("lab" | "oklab") "(" (
(
[s]* :(lab_lightness) [s]+ :(lab_astar) [s]+ :(lab_bstar) [s]* ((slash_sep :(lab_alpha))? [s]*)?
)
) ")"
)
|
(
# LCH / OKLCH
# https://w3c.github.io/csswg-drafts/css-color/#specifying-lab-lch
# lch() = lch( [<percentage> | <number> | none]
# [ <percentage> | <number> | none]
# [ <hue> | none]
# [ / [<alpha-value> | none] ]? )
# Percentages: Allowed for L and C
# Percent reference range for L: 0% = 0.0, 100% = 100.0
# for C: 0% = 0, 100% = 150
let lch_lightness = percentage | zero_hundred_number;
let lch_chroma = percentage | ((range "0"-"149" decimal_end?) | "150" zero_decimal_end?);
let lch_hue = hue_number;
let lch_alpha = alpha_number;
:("lch" | "oklch") "(" (
(
[s]* :(lch_lightness) [s]+ :(lch_chroma) [s]+ :(lch_hue) [s]* ((slash_sep :(lch_alpha))? [s]*)?
)
) ")"
)
|
(
# COLOR
# https://w3c.github.io/csswg-drafts/css-color/#funcdef-color
# color() = color( <colorspace-params> [ / [ <alpha-value> | none ] ]? )
# <colorspace-params> = [ <predefined-rgb-params> | <xyz-params>]
# <predefined-rgb-params> = <predefined-rgb> [ <number> | <percentage> | none ]{3}
# <predefined-rgb> = srgb | srgb-linear | display-p3 | a98-rgb | prophoto-rgb | rec2020
# <xyz-params> = <xyz-space> [ <number> | <percentage> | none ]{3}
# <xyz-space> = xyz | xyz-d50 | xyz-d65
# Commas are completely optional except for between the alpha where a slash is required.
# XYZ Space can be negative and above 100%.
let color_predefined_rgb = "srgb" | "srgb-linear" | "display-p3" | "a98-rgb" | "prophoto-rgb" | "rec2020";
let color_xyz_space = "xyz" | "xyz-d50" | "xyz-d65";
let color_sep = [s]+ | comma_sep;
let color_slash_sep = [s]+ slash_sep;
let color_predefined_rgb_number = zero_one_number | percentage;
let color_xyz_space_number = number "%"?;
:("color") "(" (
(
:(color_predefined_rgb) color_sep :(color_predefined_rgb_number) color_sep :(color_predefined_rgb_number) color_sep :(color_predefined_rgb_number) ((color_slash_sep :(alpha_number))? [s]*)?
)
|
(
:(color_xyz_space) color_sep :(color_xyz_space_number) color_sep :(color_xyz_space_number) color_sep :(color_xyz_space_number) ((color_slash_sep :(alpha_number))? [s]*)?
)
) ")"
)
|
:(
# <named-color>
# https://w3c.github.io/csswg-drafts/css-color/#named-colors
# <system-color>
# https://w3c.github.io/csswg-drafts/css-color/#css-system-colors
# currentColor
# https://w3c.github.io/csswg-drafts/css-color/#currentcolor-color
# transparent
# https://w3c.github.io/csswg-drafts/css-color/#transparent-color
# "inherit" is a CSS property, not a color. It's not in the color spec, so it's not included.
# The list is combined and reverse sorted ignoring case in order to ensure that colors like "GrayText" get matched as they are instead of like "gray".
"yellowgreen" | "yellow" | "whitesmoke" | "white" | "wheat" | "VisitedText" | "violet" | "turquoise" | "transparent" | "tomato" | "thistle" | "teal" | "tan" | "steelblue" | "springgreen" | "snow" | "slategrey" | "slategray" | "slateblue" | "skyblue" | "silver" | "sienna" | "SelectedItemText" | "SelectedItem" | "seashell" | "seagreen" | "sandybrown" | "salmon" | "saddlebrown" | "royalblue" | "rosybrown" | "red" | "rebeccapurple" | "purple" | "powderblue" | "plum" | "pink" | "peru" | "peachpuff" | "papayawhip" | "palevioletred" | "paleturquoise" | "palegreen" | "palegoldenrod" | "orchid" | "orangered" | "orange" | "olivedrab" | "olive" | "oldlace" | "navy" | "navajowhite" | "moccasin" | "mistyrose" | "mintcream" | "midnightblue" | "mediumvioletred" | "mediumturquoise" | "mediumspringgreen" | "mediumslateblue" | "mediumseagreen" | "mediumpurple" | "mediumorchid" | "mediumblue" | "mediumaquamarine" | "maroon" | "MarkText" | "Mark" | "magenta" | "LinkText" | "linen" | "limegreen" | "lime" | "lightyellow" | "lightsteelblue" | "lightslategrey" | "lightslategray" | "lightskyblue" | "lightseagreen" | "lightsalmon" | "lightpink" | "lightgrey" | "lightgreen" | "lightgray" | "lightgoldenrodyellow" | "lightcyan" | "lightcoral" | "lightblue" | "lemonchiffon" | "lawngreen" | "lavenderblush" | "lavender" | "khaki" | "ivory" | "indigo" | "indianred" | "hotpink" | "honeydew" | "HighlightText" | "Highlight" | "grey" | "greenyellow" | "green" | "GrayText" | "gray" | "goldenrod" | "gold" | "ghostwhite" | "gainsboro" | "fuchsia" | "forestgreen" | "floralwhite" | "firebrick" | "FieldText" | "Field" | "dodgerblue" | "dimgrey" | "dimgray" | "deepskyblue" | "deeppink" | "darkviolet" | "darkturquoise" | "darkslategrey" | "darkslategray" | "darkslateblue" | "darkseagreen" | "darksalmon" | "darkred" | "darkorchid" | "darkorange" | "darkolivegreen" | "darkmagenta" | "darkkhaki" | "darkgrey" | "darkgreen" | "darkgray" | "darkgoldenrod" | "darkcyan" | "darkblue" | "cyan" | "currentColor" | "crimson" | "cornsilk" | "cornflowerblue" | "coral" | "chocolate" | "chartreuse" | "CanvasText" | "Canvas" | "cadetblue" | "ButtonText" | "ButtonFace" | "ButtonBorder" | "burlywood" | "brown" | "blueviolet" | "blue" | "blanchedalmond" | "black" | "bisque" | "beige" | "azure" | "aquamarine" | "aqua" | "antiquewhite" | "aliceblue" | "ActiveText" | "AccentColorText" | "AccentColor"
)
)