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
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.

AVAILABILITY
This function is available since SDL 3.0.0.

SEE ALSO
SDL_DestroyPalette(3), SDL_SetPaletteColors(3), SDL_SetPixelFormatPalette(3)