note 76891 added to function.imagecolorallocate
| From: | info at marc-gutt dot deMarcGutt | Date: | Sat, 04 Aug 2007 00:50:02 +0000 |
| Subject: | note 76891 added to function.imagecolorallocate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129163@lists.php.net to get a copy of this message | ||
rgb from hex without creating a new function or using split features:
<?php
$color = 'FF9900';
$color = imagecolorallocate($im, hexdec('0x' . $color{0} . $color{1}),
hexdec('0x' . $color{2} . $color{3}), hexdec('0x' . $color{4} . $color{5}));
?>
You can validate $color with preg_match('#[a-z0-9]{6}#i', $color) if necessary.
----
Server IP: 217.160.72.57
Probable Submitter: 88.76.52.125
----
Manual Page -- http://www.php.net/manual/en/function.imagecolorallocate.php
Edit -- https://master.php.net/note/edit/76891
Del: integrated -- https://master.php.net/note/delete/76891/integrated
Del: useless -- https://master.php.net/note/delete/76891/useless
Del: bad code -- https://master.php.net/note/delete/76891/bad+code
Del: spam -- https://master.php.net/note/delete/76891/spam
Del: non-english -- https://master.php.net/note/delete/76891/non-english
Del: in docs -- https://master.php.net/note/delete/76891/in+docs
Del: other reasons-- https://master.php.net/note/delete/76891
Reject -- https://master.php.net/note/reject/76891
Search -- https://master.php.net/manage/user-notes.php