SDL_Palette(3)

SDL_Palette3

Color palette for 8-bit pixel formats

Structure definition

typedef struct{
  int ncolors;
  SDL_Color *colors;
} SDL_Palette;

Structure data

ncolors

Number of colors used in this palette

colors

Pointer to SDL_Color structures that make up the palette.

Overview

Each pixel in an 8-bit surface is an index into the colors field of the SDL_Palette structure store in SDL_PixelFormat. A SDL_Palette should never need to be created manually. It is automatically created when SDL allocates a SDL_PixelFormat for a surface. The colors values of a SDL_Surfaces palette can be set with the SDL_SetColors.

Releases

11 releases since Debian 3.0 (Woody); the text changed 1 time.

  1. 3.0–5.0
  2. 6.0–12

From libsdl1.2-dev 1.2.15+dfsg2-8 in Debian 12 (Bookworm). Parsed by carta from the page's man source.