1SDL::Palette(3) User Contributed Perl Documentation SDL::Palette(3)
2
3
4
6 SDL::Palette -- Color palette for 8-bit pixel formats
7
9 Core, Video, Structure
10
12 Each pixel in an 8-bit surface is an index into the colors field of the
13 "SDL::Palette" object stored in its "SDL::PixelFormat". A
14 "SDL::Palette" is created automatically when SDL allocates a
15 "SDL::PixelFormat" for a surface. This class has methods for returning
16 the colors in a palette object. The colors can be set with
17 SDL::Video::set_colors and SDL::Video::set_palette.
18
20 ncolors
21 $ncolors = $palette->ncolors();
22
23 Returns the number of colors in palette.
24
25 colors
26 @colors = @{ $palette->colors() };
27
28 Returns an array, "ncolors" in length, of the SDL::Colors in the
29 palette.
30
31 color_index
32 $color = $palette->color_index( $index );
33
34 Returns the SDL::Color at the provided index of the palette.
35
37 SDL::Video SDL::PixelFormat SDL::Color SDL::Surface
38
40 See "AUTHORS" in SDL.
41
42
43
44perl v5.32.0 2020-07-28 SDL::Palette(3)