SDL_SetPaletteColors(3)
β¨ SDL_SetPaletteColors(3) β¨
okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and it's literally about painting a whole lil' chunk of a palette at once π buckle up.
π NAME π
SDL_SetPaletteColors β set a range of colors in a palette. not one, not two, a whole range bestie. iconic behaviour fr fr π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_pixels.h>
bool SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
πΈ FUNCTION PARAMETERS πΈ
paletteβ theSDL_Palettestructure you're gonna modify. this is the glow-up target, the main character πcolorsβ an array ofSDL_Colorstructures that get copied into the palette. it's giving "here's my palette inspo board" π¨firstcolorβ the index of the first palette entry to modify. where the makeover starts, no cap.ncolorsβ the number of entries to modify. how many of them are getting the treatment π
π«Ά RETURN VALUE π«Ά
Returns true on success or false on failure. and if it's a flop? call SDL_GetError() for more information, she'll tell you exactly what went wrong π
π₯ THREAD SAFETY π₯
It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread. so like, share the vibes, not the same palette at the same time, yk? respect the boundaries bestie π§
π AVAILABILITY π
This function is available since SDL 3.2.0. she's been serving since day one β
that's the whole page babes, every flag, every param, every vibe check, all accounted for π
made with love by Simple Directmedia Layer, SDL 3.4.18, and yours truly β mwah, go set some colors ππ β¨
π¦ 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