in reply to
Re: allocating/deallocating colors with GD module.
in thread allocating/deallocating colors with GD module.
I'm making a julia fractal, i've added the code:
$img = new GD::Image(400,400);
$black = $img->colorAllocate(0,0,0);
$bl = $img->colorAllocate(0,0,50);
$blue = $img->colorAllocate(0,0,50);
$c = cplx(-0.70,-0.38);
$z = cplx($x/100,$y/100);
$teller = 0;
$zz = $z**2 + $c;
$bl = $img->colorAllocate(0,0,25*$teller);
$z = $zz;
So after 3 iterations i want the blue component($bl) to be 25 * $teller, so a maximum of 200. But on the picture the blue becomes brighter(must be 100) only once. As if it deallocated once(it was 50 to start with, as you can see at the beginning) and not every time that part of code is executed. So my question is: can you deallocate a color and then allocate it again like in my program. And is this really necessary, because like i said in my original question sometimes you can simply allocate it with different rgb-components without deallocating it first. Thank you.