SDL_Palette(3type)

πŸ’– SDL_Palette πŸ’–

okay bestie, welcome to the SDL3 DATATYPES corner of the manual, and today's main character is SDL_Palette β€” it's giving a whole vibe, it's giving a set of indexed colors representing a palette. that's it. that's the whole name. slay.


✨ NAME ✨

SDL_Palette β€” a set of indexed colors representing a palette. literally what it says on the tin, no notes πŸŽ€


🌸 SYNOPSIS 🌸

first things first, you gotta bring it in:

#include <SDL3/SDL_pixels.h>

and here's the struct itself, bestie, look at her:

typedef struct SDL_Palette
{
    int ncolors;        /**< number of elements in `colors`. */
    SDL_Color *colors;  /**< an array of colors, `ncolors` long. */
    Uint32 version;     /**< internal use only, do not touch. */
    int refcount;       /**< internal use only, do not touch. */
} SDL_Palette;

let's break her down, one field at a time 🧚

  • int ncolors β€” how many elements are chillin' in colors. that's the count, bestie, nothing more.
  • SDL_Color *colors β€” a whole array of colors, ncolors long. your actual palette contents, the moment πŸ’…
  • Uint32 version β€” internal use only, do not touch. i'm so serious. hands off. πŸ™ˆ
  • int refcount β€” internal use only, do not touch. same energy, same warning. do NOT be messing with her.
fr fr, version and refcount are SDL's business, not yours. the manpage says it twice and so do i. internal use only, do not touch. periodt.

🌈 AVAILABILITY 🌈

this struct has been around since SDL 3.2.0. she's not new new, she's established. iconic behavior πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

go read her bestie next:

iykyk πŸ’œ


Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_Palette(3type) β€” that's the source, the version, and the page, all wrapped up in a little bow for you πŸŽ€ thanks for reading bestie, go touch some pixels (but not the internal fields) πŸ’–βœ¨

πŸ“¦ where this page comes from