Color manipulation

Uint32 sge_MapAlpha(Uint8 R, Uint8 G, Uint8 B, Uint8 A)
Use this function to map Uint32 color values (RGBA) for *32bit* alpha surfaces. The color value can then be used with any of SGEs functions.

SDL_Color sge_FillPaletteEntry(Uint8 R, Uint8 G, Uint8 B)
Fills a palette entry (SDL_Color) with R, G, B components.

SDL_Color sge_GetRGB(SDL_Surface *Surface, Uint32 Color)
Get the RGB of a color value.

void sge_Fader(SDL_Surface *Surface, Uint8 sR,Uint8 sG,Uint8 sB, Uint8 dR,Uint8 dG,Uint8 dB,Uint32 *ctab,int start, int stop)
Fades from (sR,sG,sB) to (dR,dG,dB), puts result (32-bit pixel format) in ctab[start] to ctab[stop].

void sge_AlphaFader(Uint8 sR,Uint8 sG,Uint8 sB,Uint8 sA, Uint8 dR,Uint8 dG,Uint8 dB,Uint8 dA, Uint32 *ctab,int start, int stop)
Fades from (sR,sG,sB,sA) to (dR,dG,dB,dA), puts result (32-bit alpha pixel format) in ctab[start] to ctab[stop].

void sge_SetupRainbowPalette(SDL_Surface *Surface,Uint32 *ctab,int intensity, int start, int stop)
Copies a nice rainbow palette to the color table (ctab[start] to ctab[stop]). You must also set the intensity of the palette (0-bright 255-dark)

void sge_SetupBWPalette(SDL_Surface *Surface,Uint32 *ctab,int start, int stop)
Copies a B&W palette to the color table (ctab[start] to ctab[stop]).





Copyright © 1999-2003 Anders Lindström
Last updated 030808