/lib/pods/SDL/Palette.pod

http://github.com/PerlGameDev/SDL · Unknown · 47 lines · 25 code · 22 blank · 0 comment · 0 complexity · 5c4a7f73e5a8ca5100a4c5ba46b8ab6e MD5 · raw file

  1. =pod
  2. =head1 NAME
  3. SDL::Palette -- Color palette for 8-bit pixel formats
  4. =head1 CATEGORY
  5. Core, Video, Structure
  6. =head1 DESCRIPTION
  7. Each pixel in an 8-bit surface is an index into the colors field of the C<SDL::Palette> object stored in its C<SDL::PixelFormat>.
  8. A C<SDL::Palette> is created automatically when SDL allocates a C<SDL::PixelFormat> for a surface.
  9. This class has methods for returning the colors in a palette object.
  10. The colors can be set with L<SDL::Video::set_colors|SDL::Video/set_colors> and L<SDL::Video::set_palette|SDL::Video/set_palette>.
  11. =head1 METHODS
  12. =head2 ncolors
  13. $ncolors = $palette->ncolors();
  14. Returns the number of colors in palette.
  15. =head2 colors
  16. @colors = @{ $palette->colors() };
  17. Returns an array, C<ncolors> in length, of the L<SDL::Color>s in the palette.
  18. =head2 color_index
  19. $color = $palette->color_index( $index );
  20. Returns the L<SDL::Color> at the provided index of the palette.
  21. =head1 SEE ALSO
  22. L<SDL::Video> L<SDL::PixelFormat> L<SDL::Color> L<SDL::Surface>
  23. =head1 AUTHORS
  24. See L<SDL/AUTHORS>.
  25. =cut