Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm making some graphics wherein I want to loop through the RedGreenBlue color-components. Sometimes I can simply write something like:
$x = 20; $white=$img->colorAllocate(255,$x*2,255); $img->line(0,0,50,50,$white); $white = $img->colorAllocate(255,$x*10,150); $img->line(50,50,150,250,$white);
And then it works. Sometimes this doesn't work so i try to deallocate f.e.:
$blue = $img->colorAllocate(0,0,25); $img->colorDeallocate($blue); $blue = $img->colorAllocate(0,0,25*$teller);
But this doesn't work either. Can someone tell me how to do this? Thank you.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: allocating/deallocating colors with GD module.
by BrowserUk (Patriarch) on Jun 24, 2013 at 21:13 UTC | |
by Anonymous Monk on Jun 25, 2013 at 07:41 UTC | |
Re: allocating/deallocating colors with GD module.
by moritz (Cardinal) on Jun 24, 2013 at 17:16 UTC | |
by Anonymous Monk on Jun 24, 2013 at 17:48 UTC | |
Re: allocating/deallocating colors with GD module.
by Loops (Curate) on Jun 24, 2013 at 17:10 UTC | |
Re: allocating/deallocating colors with GD module.
by Anonymous Monk on Jul 21, 2013 at 08:13 UTC |
Back to
Seekers of Perl Wisdom