Created
September 8, 2014 07:28
-
-
Save kruxor/8ad1da44a7865208f0e5 to your computer and use it in GitHub Desktop.
return a random hex color value in php
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
function rand_color() { | |
return '#' . str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment