PHP allocate color without image resource

praitiady

New Member
Can you allocate a color in \[code\]PHP GD\[/code\] without an \[code\]image resource\[/code\]? It should be possible because really an allocated color is a number, right?\[code\]$im = imagecreatetruecolor(100, 100);$col = imagecolorallocate($im, 255, 0, 0);print $col."<br/>";$col2 = imagecolorallocate($im, 255, 0, 0);print $col2."<br/>";$im2 = imagecreatetruecolor(600, 100);$col3 = imagecolorallocate($im, 255, 0, 0);print $col3;\[/code\]This prints out:167116801671168016711680I guess what the real question is how 255, 0, and 0 are made into 16711680.
 
Back
Top