This trick was inspired by Brian Suda who I saw speak at Whisky Web.
- Take a string, any string.
- Hash it using MD5.
- Substring the hash to get a 6-digit hex code.
- Take a look at what colour that hex code represents.
A really simple, really cool way of generating seemingly random colours, that can be used to represent things.
I had a play with this idea and used it to generate a simple flag for any input string:
This takes an input string via the GET method variable ‘thing’ and turns it in to a 3-stripe flag. Examples:
” (empty string):
‘ben’:
‘bennuttall’:
‘bennuttall.com’:
See this on github: github.com/bennuttall/MD5-Flag-Generator/
Check out Brian’s book Designing With Data
Also have a play with this – I put the code up on my site here