note 36329 deleted from function.imagecolorallocate by didou
| From: | didou@php.net | Date: | Mon, 09 Feb 2004 10:25:13 +0000 |
| Subject: | note 36329 deleted from function.imagecolorallocate by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64873@lists.php.net to get a copy of this message | ||
Note Submitter: folke@ashberg.de
----
If you want to set an HEX RGB color (#F2C944) use that function
<?
function ImageColorAllocateHEX($im,$s){
if ($s[0]=="#") $s=substr($s,1);
$bg_dec=hexdec($s);
return imagecolorallocate($im,
($bg_dec & 0xFF0000) >> 16,
($bg_dec & 0x00FF00) >> 8,
($bg_dec & 0x0000FF)
);
}
?>
and then call
ImageColorAllocateHEX($im,"#F2C944");