Skip to content

Instantly share code, notes, and snippets.

@rafaelnovello
Forked from geraldo-zampoli/Colors.py
Last active May 19, 2017 09:37
Show Gist options
  • Save rafaelnovello/5161261 to your computer and use it in GitHub Desktop.
Save rafaelnovello/5161261 to your computer and use it in GitHub Desktop.
from xlwt import Workbook, easyxf
colors = ['aqua', 'black', 'blue', 'blue_gray', 'bright_green', 'brown', 'coral', 'cyan_ega',
'dark_blue', 'dark_blue_ega', 'dark_green', 'dark_green_ega', 'dark_purple', 'dark_red',
'dark_red_ega', 'dark_teal', 'dark_yellow', 'gold', 'gray_ega', 'gray25', 'gray40', 'gray50',
'gray80', 'green', 'ice_blue', 'indigo', 'ivory', 'lavender', 'light_blue', 'light_green',
'light_orange', 'light_turquoise', 'light_yellow', 'lime', 'magenta_ega', 'ocean_blue',
'olive_ega', 'olive_green', 'orange', 'pale_blue', 'periwinkle', 'pink', 'plum', 'purple_ega',
'red', 'rose', 'sea_green', 'silver_ega', 'sky_blue', 'tan', 'teal', 'teal_ega', 'turquoise',
'violet', 'white', 'yellow']
book = Workbook()
sheet = book.add_sheet('Color')
for x in range(0, 14):
for y in range(0, 4):
color = colors.pop()
sheet.write(x, y, color, easyxf('pattern: pattern solid, fore_colour %s' % color))
book.save('color.xls')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment