Allegro::Palette - Allegro Palette object
use Allegro; $al = Allegro->new() or die; $d = $al->Display(width => 640, height => 480) or die $al->error; $bmp = $d->Bitmap(file => 'test.pcx') or die; $d->palette($bmp->palette); $d->blit($bmp); sleep;
The Palette object holds a set of color entries for 8-bit color modes. Palettes can be loaded from datafiles or bitmap files.
To access a Palette object from a Bitmap object, use Bitmap's palette method. Palettes can also be loaded like any other datafile object. To set a palette see the palette method of Allegro::Display.
Creates a new Palette object. Does not take any parameters.
$pal = $al->Palette();
Sets the specified index to a certain color.
$pal->set($index, $red, $green, $blue);
Index to set. Valid values are 0-255.
Red/Green/Blue values for this index. Valid values are 0-255.
Returns a list containing the red, green, and blue values for the specified index.
($r, $g, $b) = $pal->get($index);
Colin O'Leary <colino@cpan.org>
Copyright 2003 by Colin O'Leary. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The Allegro library is copyright its authors, and is giftware. See http://alleg.sf.net for more information.
To install Allegro, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Allegro
CPAN shell
perl -MCPAN -e shell install Allegro
For more information on module installation, please visit the detailed CPAN module installation guide.