logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL::Palette -- Color palette for 8-bit pixel formats

Authors

       See "AUTHORS" in SDL.

perl v5.40.0                                       2024-10-20                            pods::SDL::Palette(3pm)

Category

       Core, Video, Structure

Description

       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.

Name

       SDL::Palette -- Color palette for 8-bit pixel formats

See Also

       SDL::Video SDL::PixelFormat SDL::Color SDL::Surface

See Also