| Trees | Indices | Help |
|
|---|
|
|
1 import re
2
3 f = open("/etc/X11/rgb.txt")
4
5 print "colors = {"
6 for l in f.readlines():
7 if l.startswith("!"): continue
8 c = re.split("[ \t]+", l.strip())
9 rgb, names = map(int, c[:3]), c[3:]
10 rgb = [float(c) / 255.0 for c in rgb]
11 for n in names:
12 print ' %-24s: (%.2f, %.2f, %.2f),' % ('"%s"' % n.lower(), rgb[0], rgb[1], rgb[2])
13 print "}"
14
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Sat Oct 20 15:25:06 2007 | http://epydoc.sourceforge.net |