Create a gist now

Instantly share code, notes, and snippets.

Quick script that generates HTML output for visualizing the color scheme for participation certificates at Umit Project. More about this code: http://blog.umitproject.org/2013/03/honoring-certificates-for-all-past.html
#!/usr/bin/env python
"""Quick script that generates HTML output for visualizing the color scheme for
participation certificates at Umit Project. More about this code: http://blog.umitproject.org/2013/03/honoring-certificates-for-all-past.html
"""
import time
print "<html>"
print "<head><title>Umit Certificate Colors</title></head>"
print "<body>"
for year in xrange(2007,2013):
color = str(time.mktime((year, 8, 29, 1, 1, 1, 0, 1, 0))).split(".")[0][:-2][-6:]
inverse = str(hex(int(color, 16) ^ int("F"*6, 16)))[2:]
print "<div style='text-align:center; font-weight:bold; font-size:22px; width:100%%; height:4em; background-color:#%s'><span style='color:#%s;'>%s - #%s - #%s</span></div>" % (color, inverse, year, color, inverse)
print "</body>"
print "</html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment