Created
April 27, 2016 03:19
-
-
Save trevorgreenleaf/3463efa8b38dc6f727d45f2896816856 to your computer and use it in GitHub Desktop.
Colors with Decimals and Hex as an array
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<?php | |
function toColor($n){ | |
return("#".substr("000000".dechex($n),-6)); | |
} | |
echo $color2 = toColor(47020); | |
$color_options = array('',','',','',''); | |
$c1 = 'FF'; | |
$c2 = '00'; | |
$c3 = '00'; | |
$color = '#'.$c1.$c2.$c3; | |
echo '<body style="background-color:'.$color2.';"></body>'; | |
?> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment