Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php color generator

function randomRGB()
{
    $r = rand(0, 255);
    $g = rand(0, 255);
    $b = rand(0, 255);

    return "rgb({$r}, {$g}, {$b})";
}

function randomHexColor()
{
    return '#' . substr(str_shuffle('ABCDEF0123456789'), 0, 6);
}

$hexColor = randomHexColor();
$rgbColor = randomRGB();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #color #generator
ADD COMMENT
Topic
Name
2+6 =