SDL_SetPaletteColors - Man Page

Set a range of colors in a palette.

Header File

Defined in SDL3/SDL_pixels.h

Synopsis

#include "SDL3/SDL.h"

bool SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);

Function Parameters

palette

the SDL_Palette
structure to modify.

colors

an array of SDL_Color
structures to copy into the palette.

firstcolor

the index of the first palette entry to modify.

ncolors

the number of entries to modify.

Return Value

Returns true on success or false on failure; call

SDL_GetError () for more information.

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.

Availability

This function is available since SDL 3.2.0.

Referenced By

SDL_CreatePalette(3), SDL_CreateSurfacePalette(3), SDL_Palette.3type(3).

SDL 3.2.2 Simple Directmedia Layer SDL3 FUNCTIONS