note 60439 added to function.imagecolorallocate

From: Date: Fri, 06 Jan 2006 23:45:58 +0000
Subject: note 60439 added to function.imagecolorallocate
Groups: php.notes 
Request: Send a blank email to php-notes+get-101329@lists.php.net to get a copy of this message
I hope this isn't redundant or already documented, but I wanted a way to take a color as returned by imagecolorallocate(), and extract its RGB values (because maybe I wanted to pass colors around with functions and do stuff with their values. All this function does is break a 3 byte number. $color=$imagecolorallocate($image,200,200,200); die(print_r(ImageColorToRGB($color))); function ImageColorToRGB($color) { $arr=array(); $arr[0]=$arr['r']=(($transparent>>16) & 0xFF); $arr[1]=$arr['g']=(($transparent>>8) & 0xFF); $arr[2]=$arr['b']=(($transparent) & 0xFF); return $arr; } ---- Manual Page -- http://www.php.net/manual/en/function.imagecolorallocate.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60439 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60439&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60439&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60439&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60439&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60439&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60439&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60439&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60439&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101329) next »