Files
sugar-toolkit-gtk3/tools/hex-colors-to-dict
T

19 lines
261 B
Python
Raw Normal View History

2006-08-19 14:27:56 +02:00
#!/usr/bin/python
import sys
result = 'colors = [\n'
2006-08-19 14:27:56 +02:00
hex_file = open(sys.argv[1], 'r')
for line in hex_file.readlines():
[ stroke, fill ] = line.split()
result += '[\'#%s\', \'#%s\'], \\\n' % (fill, stroke)
2006-08-19 14:27:56 +02:00
result += ']'
2006-08-19 14:27:56 +02:00
hex_file.close()
print result