SDL_CreatePalette(3)

NAME
SDL_CreatePalette - Create a palette structure with the specified number of color entries.

HEADER FILE
Defined in SDL3/SDL_pixels.h

SYNOPSIS
#include "SDL3/SDL.h"

SDL_Palette * SDL_CreatePalette(int ncolors);

DESCRIPTION
The palette entries are initialized to white.

FUNCTION PARAMETERS

ncolors
    represents the number of color entries in the color palette.

RETURN VALUE
( SDL_Palette
 *) Returns a new SDL_Palette

structure on success or NULL on failure (e.g. if there wasn't enough memory); call SDL_GetError () for more information.

THREAD SAFETY
It is safe to call this function from any thread.

AVAILABILITY
This function is available since SDL 3.2.0.

SEE ALSO
•(3), SDL_DestroyPalette(3), •(3), SDL_SetPaletteColors(3), •(3), SDL_SetSurfacePalette(3)