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' incolors. that's the count, bestie, nothing more.SDL_Color *colorsβ a whole array of colors,ncolorslong. 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,versionandrefcountare 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
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms