SDL::Palette(3pm)

SDL::Palette3pm

Category

Core, Video, Structure

Overview

Each pixel in an 8-bit surface is an index into the colors field of the "SDL::Palette" object stored in its "SDL::PixelFormat". A "SDL::Palette" is created automatically when SDL allocates a "SDL::PixelFormat" for a surface. This class has methods for returning the colors in a palette object. The colors can be set with SDL::Video::set_colors and SDL::Video::set_palette.

Methods

ncolors

  $ncolors = $palette->ncolors();

Returns the number of colors in palette.

colors

  @colors = @{ $palette->colors() };

Returns an array, "ncolors" in length, of the SDL::Colors in the palette.

color_index

  $color = $palette->color_index( $index );

Returns the SDL::Color at the provided index of the palette.

Releases

11 releases since Debian 3.1 (Sarge); the text changed 10 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9
  8. 10
  9. 11
  10. 12
  11. 13

Authors

See "AUTHORS" in SDL.

From libsdl-perl 2.548-5+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.