note 36329 added to function.imagecolorallocate

From: Date: Mon, 06 Oct 2003 00:38:06 +0000
Subject: note 36329 added to function.imagecolorallocate
Groups: php.notes 
Request: Send a blank email to php-notes+get-57861@lists.php.net to get a copy of this message
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"); ---- Manual Page -- http://www.php.net/manual/en/function.imagecolorallocate.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36329 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36329&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36329&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#57861) next »