note 103092 added to function.imagecolorexact
| From: | samtobiaatgeemaildotcom at osu1 dot php dot net | Date: | Fri, 25 Mar 2011 06:11:06 +0000 |
| Subject: | note 103092 added to function.imagecolorexact | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178193@lists.php.net to get a copy of this message | ||
A script that changes colors depending on get variable
important to note: I had little success with pngs and getting true red
gifs work much better
<?php
//0 is yellow, 1 is red, 2 is blue
$y = 1 - ceil($_GET["c"]/2);
$r = 1 - floor($_GET["c"]/2);
$b = floor($_GET["c"]/2);
$gd = imagecreatefromgif("example.gif");
imagecolorset($gd, imagecolorexact($gd, 255, 0, 0), $r*255, $y*255, $b*255);
imagecolorset($gd, imagecolorexact($gd, 191, 0, 0), $r*191, $y*191, $b*191);
imagecolorset($gd, imagecolorexact($gd, 128, 0, 0), $r*128, $y*128, $b*128);
imagecolorset($gd, imagecolorexact($gd, 255, 0, 0), $r*64, $y*64, $b*64);
header('Content-Type: image/gif');
imagegif($gd);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 68.44.99.176
----
Manual Page -- http://www.php.net/manual/en/function.imagecolorexact.php
Edit -- https://master.php.net/note/edit/103092
Del: integrated -- https://master.php.net/note/delete/103092/integrated
Del: useless -- https://master.php.net/note/delete/103092/useless
Del: bad code -- https://master.php.net/note/delete/103092/bad+code
Del: spam -- https://master.php.net/note/delete/103092/spam
Del: non-english -- https://master.php.net/note/delete/103092/non-english
Del: in docs -- https://master.php.net/note/delete/103092/in+docs
Del: other reasons-- https://master.php.net/note/delete/103092
Reject -- https://master.php.net/note/reject/103092
Search -- https://master.php.net/manage/user-notes.php