Skip to content

Instantly share code, notes, and snippets.

@banterability
Created August 11, 2010 17:55
Show Gist options
  • Save banterability/519401 to your computer and use it in GitHub Desktop.
Save banterability/519401 to your computer and use it in GitHub Desktop.
unique colors for each neighborhood of South Los Angeles
# inspired by dopplr's color squares
# http://blog.dopplr.com/2007/10/23/in-rainbows/
from hashlib import md5
from string import Template
hood_block = Template("""
<div class="neighborhood" id="$cityid">
<div class="neighborhood-color" style="background-color:#$bghex;"></div>
<div class="neighborhood-text">$cityname</div>
</div>
""")
neighborhoods = [
"Arlington Park",
"Athens on the Hill",
"Baldwin Hills Estates",
"Baldwin Hills",
"Baldwin Village",
"Baldwin Vista",
"Cameo Plaza",
"Canterbury Knolls",
"Century Palms",
"Chesterfield Square",
"Crenshaw",
"Exposition Park",
"Figueroa Corridor",
"Gramercy Park",
"Green Meadows",
"Hyde Park",
"Jefferson Park",
"King Estates",
"Kinney Heights",
"Leimert Park",
"Magnolia Square",
"Manchester Square",
"Morningside Circle",
"North University Park",
"South Los Angeles",
"University Park",
"Vermont Knolls",
"Vermont Park",
"Vermont Square",
"View Heights",
"Village Green",
"Watts",
"West Adams",
"West Alameda",
"West Park Terrace"
]
for hood in neighborhoods:
hash = md5(hood).hexdigest()
print hood_block.substitute(
cityid=hood.lower().replace(' ','-'),
bghex= hash[:6],
cityname=hood
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment