note 69751 modified in function.imagecolorallocate by danbrown
| From: | danbrown@php.net | Date: | Fri, 24 Apr 2009 12:46:52 +0000 |
| Subject: | note 69751 modified in function.imagecolorallocate by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153662@lists.php.net to get a copy of this message | ||
This might help someone who want to use 'ImageColorAllocate ' with a hex value
<?php
function ImageColorAllocateFromHex ($img, $hexstr)
{
$int = hexdec($hexstr);
return ImageColorAllocate ($img,
0xFF & ($int >> 0x10),
0xFF & ($int >> 0x8),
0xFF & $int);
}
?>
--was--
This might help someone who want to use 'ImageColorAllocate ' with a hex value
function ImageColorAllocateFromHex ($img, $hexstr)
{
$int = hexdec($hexstr);
return ImageColorAllocate ($img,
0xFF & ($int >> 0x10),
0xFF & ($int >> 0x8),
0xFF & $int);
}
http://php.net/manual/en/function.imagecolorallocate.php