Skip to content

Instantly share code, notes, and snippets.

@bennuttall
Last active December 11, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennuttall/4651986 to your computer and use it in GitHub Desktop.
Save bennuttall/4651986 to your computer and use it in GitHub Desktop.
<?php
$thing = $_GET['thing'];
$md5 = md5($thing);
$col1 = substr($md5, 0, 6);
$col2 = substr($md5, 6, 6);
$col3 = substr($md5, 12, 6);
echo
"<div style='float:left;width:100px;height:200px;background:#{$col1}'></div>\n" .
"<div style='float:left;width:100px;height:200px;background:#{$col2}'></div>\n"
"<div style='float:left;width:100px;height:200px;background:#{$col3}'></div>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment