Created
March 21, 2013 11:50
-
-
Save adrianomarques/5212470 to your computer and use it in GitHub Desktop.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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