-
Notifications
You must be signed in to change notification settings - Fork 0
/
colortest.html
51 lines (48 loc) · 1.69 KB
/
colortest.html
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
<html>
<head>
<title>HTML color test for Kiki
</title>
</head>
<body>
<b>
<font color="#000000">( )</font><br />
1.<br />
<font color="#0000AA">( )</font><br />
<font color="#00AA00">( )</font><br />
<font color="#FFAA55">( )</font><br />
<font color="#AA0000">( )</font><br />
<font color="#00AAAA">( )</font><br />
<font color="#AA00AA">( )</font><br />
<font color="#AAAAAA">( )</font><br />
2.<br />
<font color="#0000FF">( )</font><br />
<font color="#00FF00">( )</font><br />
<font color="#00FFFF">( )</font><br />
<font color="#FF0000">( )</font><br />
<font color="#DDDD00">( )</font><br />
<font color="#FF00FF">( )</font><br />
3.<br />
<font color="#AAAAFF">( )</font><br />
<font color="#FF55AA">( )</font><br />
<font color="#AAFF55">( )</font><br />
<font color="#FFAAAA">( )</font><br />
<font color="#55AAFF">( )</font><br />
<font color="#FFAAFF">( )</font><br />
4.<br />
<font color="#000077">( )</font><br />
<font color="#007700">( )</font><br />
<font color="#770000">( )</font><br />
<font color="#007777">( )</font><br />
<font color="#770077">( )</font><br />
<font color="#777700">( )</font><br />
</b>
<pre>
The following code can be used to extract the colors from the HTML code:
import re
r = re.compile(r"#([0-9]|[A-F])+\"")
res = r.findall(<<insert html code from above>>)
for item in res:
print '"%s"' % item[0], ",",
</pre>
</body>
</html>