pods::...alette(3pm)

πŸ“¦ version 2.548, in opensuse-leap 16.0

πŸ’– 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::Video
  • SDL::PixelFormat
  • SDL::Color
  • SDL::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