Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
392 B
1
Indexable
Never
$colormap = array();
$steps = 100;
$add = 255/$steps*2;

$r = 255; $b = 0; $g = 0;

for ($i = 1; $i <= ($steps/2); $i++)
{
        $colormap[$i] = array('r' => ceil($r), 'b' => ceil($b), 'g' => ceil($g));
        $g += $add;
}
for ($i = 51; $i <= ($steps/2)+50; $i++)
{
        $colormap[$i] = array('r' => ceil($r), 'b' => ceil($b), 'g' => ceil($g));
        $r -= $add;
}