PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 2=pod
 3
 4=head1 NAME
 5
 6SDL::Palette -- Color palette for 8-bit pixel formats 
 7
 8=head1 CATEGORY
 9
10Core, Video, Structure
11
12=head1 DESCRIPTION
13
14Each 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>.
15A C<SDL::Palette> is created automatically when SDL allocates a C<SDL::PixelFormat> for a surface.
16This class has methods for returning the colors in a palette object.
17The colors can be set with L<SDL::Video::set_colors|SDL::Video/set_colors> and L<SDL::Video::set_palette|SDL::Video/set_palette>.
18
19=head1 METHODS
20
21=head2 ncolors
22
23  $ncolors = $palette->ncolors();
24
25Returns the number of colors in palette.
26
27=head2 colors
28
29  @colors = @{ $palette->colors() };
30
31Returns an array, C<ncolors> in length, of the L<SDL::Color>s in the palette.
32
33=head2 color_index
34
35  $color = $palette->color_index( $index );
36
37Returns the L<SDL::Color> at the provided index of the palette.
38
39=head1 SEE ALSO
40
41L<SDL::Video> L<SDL::PixelFormat> L<SDL::Color> L<SDL::Surface>
42
43=head1 AUTHORS
44
45See L<SDL/AUTHORS>.
46
47=cut