Last active
August 29, 2015 14:01
-
-
Save neilvallon/935d586987fd33f7d39f to your computer and use it in GitHub Desktop.
ranHexColor - May 15 2009
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
<?php | |
function ranHex(){ | |
$i = rand(0, 15); | |
switch ($i) { | |
case 0: $a = "0"; break; | |
case 1: $a = "1"; break; | |
case 2: $a = "2"; break; | |
case 3: $a = "3"; break; | |
case 4: $a = "4"; break; | |
case 5: $a = "5"; break; | |
case 6: $a = "6"; break; | |
case 7: $a = "7"; break; | |
case 8: $a = "8"; break; | |
case 9: $a = "9"; break; | |
case 10: $a = "A"; break; | |
case 11: $a = "B"; break; | |
case 12: $a = "C"; break; | |
case 13: $a = "D"; break; | |
case 14: $a = "E"; break; | |
case 15: $a = "F"; break; | |
} | |
return $a; | |
} | |
$done = ranHex().ranHex().ranHex().ranHex().ranHex().ranHex(); | |
?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | |
<title>Untitled Document</title> | |
<style type="text/css"> | |
body{ | |
background-color:#<?php echo $done; ?>; | |
} | |
.brady{ | |
font-size:72px; | |
text-align:center; | |
width:100%; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="brady"> | |
#<?php echo $done; ?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment