=begin comment

$Id$

=end comment

=head1 NAME

Allegro::Palette - Allegro Palette object

=head1 SYNOPSIS

   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;

=head1 DESCRIPTION

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 B<palette> 
method.  Palettes can also be loaded like any other datafile object.  To 
set a palette see the B<palette> method of Allegro::Display.

=head1 METHODS

=over

=item B<new>

Creates a new Palette object.  Does not take any parameters.

   $pal = $al->Palette();

=item B<set> - sets a palette entry

Sets the specified index to a certain color.

   $pal->set($index, $red, $green, $blue);

=over

=item I<index>

Index to set.  Valid values are 0-255.

=item I<red>, I<green>, I<blue>

Red/Green/Blue values for this index.  Valid values are 0-255.

=back

=item B<get> - retrieve a palette entry

Returns a list containing the red, green, and blue values for the 
specified index.

   ($r, $g, $b) = $pal->get($index);

=back

=head1 AUTHOR

Colin O'Leary <colino@cpan.org>

=head1 COPYRIGHT

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.

=head1 SEE ALSO

=over

=item L<Allegro> - Base Allegro routines

=item L<Allegro::Bitmap> - Allegro Bitmap object

=item L<Allegro::Datafile> - Allegro Datafile object

=item L<Allegro::Display> - Allegro Display object

=back

