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 β€” the SDL_Palette structure you're gonna modify. this is the glow-up target, the main character πŸ‘‘
  • colors β€” an array of SDL_Color structures 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