note 48137 added to function.imagecolorallocate
| From: | carlosreche at yahoo dot com | Date: | Mon, 13 Dec 2004 16:27:24 +0000 |
| Subject: | note 48137 added to function.imagecolorallocate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81752@lists.php.net to get a copy of this message | ||
Here is an easier way to set the color without use imagecolorallocate();
<?php
$image = imagecreatetruecolor();
imagefill($image, 0, 0, 0xFFFFFF); // white color (#FFFFFF)
?>
Use hexadecimal values just like you do in HTML codes:
0xFF0000 = red
0x00FF00 = green
0x0000FF = blue
0xFFFF00 = yellow
... and so on
Hope this will help many people...
Carlos Reche
----
Manual Page -- http://www.php.net/manual/en/function.imagecolorallocate.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48137
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48137&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48137&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48137&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48137&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48137&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48137&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48137&report=yes
Search -- http://master.php.net/manage/user-notes.php