pods::...alette(3pm)
π NAME π
pods::...alette(3pm) from User Contributed Perl Documentation is here to introduce SDL::Palette β literally the Color palette for 8-bit pixel formats. slay. β¨
π CATEGORY π
Core, Video, Structure β that's the category lineup, bestie. No cap.
β¨ DESCRIPTION β¨
Okay so picture this: each pixel in an 8-bit surface is an index into the colors field of the SDL::Palette object stored in its SDL::PixelFormat. No cap. A SDL::Palette gets created automatically when SDL allocates a SDL::PixelFormat for a surface β SDL handles the setup, you just vibe. This class has methods for returning the colors in a palette object. Wanna set the colors? That's SDL::Video::set_colors and SDL::Video::set_palette, periodt.
π METHODS π
The methods are giving utility, let's go:
π ncolors
$ncolors = $palette->ncolors();
Returns the number of colors in the palette. Simple as that.
π¦ colors
@colors = @{ $palette->colors() };
Returns an array, ncolors in length, of the SDL::Colors in the palette. Obsessed with a tidy array.
πΈ color_index
$color = $palette->color_index( $index );
Returns the SDL::Color at the provided index of the palette. iykyk.
π SEE ALSO π
SDL::VideoSDL::PixelFormatSDL::ColorSDL::Surface
π AUTHORS π
See "AUTHORS" in SDL. That's where the author receipts live.
π that's the whole page, bestie! source/version tea: perl v5.42.0, dated 2024-05-01, for pods::...alette(3pm). mwah! π
π¦ where this page comes from
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms