Palette Functions
Primitives
Polygon
Transform
Surface
Drawing
Dirty Rect
Palette
Control
Misc
Defines
Types
Extended

Arguments

Index
Credits

Return Name Arguments
SDL_Color SPG_MakeColor Uint8 R, Uint8 G, Uint8 B
SDL_ColorSPG_MakeColorAlphaUint8 R, Uint8 G, Uint8 B, Uint8 A
SDL_Color SPG_GetColor SDL_Surface* Surface, Uint32 Color
SDL_Color*SPG_ColorPalettenone
SDL_Color*SPG_GrayPalettenone
Uint32SPG_FindPaletteColorSDL_Palette* palette, Uint8 r, Uint8 g, Uint8 b
SDL_Surface*SPG_PalettizeSurfaceSDL_Surface* surface, SDL_Palette* palette
void SPG_FadedPalette32 SDL_PixelFormat* format, Uint32 color1, Uint32 color2, Uint32* colorArray, Uint16 startIndex, Uint16 stopIndex
void SPG_FadedPalette32Alpha SDL_PixelFormat* format, Uint32 color1, Uint8 alpha1,
Uint32 color2, Uint8 alpha2, Uint32* colorArray, Uint16 startIndex, Uint16 stopIndex
void SPG_RainbowPalette32 SDL_PixelFormat* format, Uint32* colorArray, Uint8 intensity, Uint16 startIndex, Uint16 stopIndex
void SPG_GrayPalette32 SDL_PixelFormat* format, Uint32* colorArray, Uint16 startIndex, Uint16 stopIndex


SDL_Color SPG_MakeColor(Uint8 R, Uint8 G, Uint8 B)
- Returns an SDL_Color structure initialized with the given RGB values.

SDL_Color SPG_MakeColorAlpha(Uint8 R, Uint8 G, Uint8 B, Uint8 A)
- Returns an SDL_Color structure initialized with the given RGBA values.

SDL_Color SPG_GetColor(SDL_Surface* Surface, Uint32 Color)
- Returns an SDL_Color structure that represents the given color in the format of the given surface.

SDL_Color* SPG_ColorPalette()
- Returns a default colorful array of SDL_Colors that can be used with SDL_SetColors or SDL_SetPalette on 8-bit surfaces.

SDL_Color* SPG_GrayPalette()
- Returns a grayscale array of SDL_Colors that can be used with SDL_SetColors or SDL_SetPalette on 8-bit surfaces.

Uint32 SPG_FindPaletteColor(SDL_Palette* palette, Uint8 r, Uint8 g, Uint8 b)
- Returns the closest match in the palette to the specified RGB combination.

SDL_Surface* SPG_PalettizeSurface(SDL_Surface* surface, SDL_Palette* palette)
- Converts a surface to 8-bit format with the given palette.  This may be a little slower than SDL_ConvertSurface, but the colors are accurate.

void SPG_FadedPalette32(SDL_PixelFormat* format, Uint32 color1, Uint32 color2, Uint32* colorArray, Uint16 startIndex, Uint16 stopIndex)
- Fills the given array from startIndex to stopIndex with 32-bit colors interpolated between the given colors.

void SPG_FadedPalette32Alpha(SDL_PixelFormat* format, Uint32 color1, Uint8 alpha1, Uint32 color2, Uint8 alpha2, Uint32* colorArray, Uint16 startIndex, Uint16 stopIndex)
- Fills the given array from startIndex to stopIndex with 32-bit colors interpolated between the given colors.

void SPG_RainbowPalette32(SDL_PixelFormat* format, Uint32* colorArray, Uint8 intensity, Uint16 startIndex, Uint16 stopIndex)
- Fills the given array from startIndex to stopIndex with a rainbow palette at the given intensity.  An intensity of 0 is gray, intensity of 255 is vivid.

void SPG_GrayPalette32(SDL_PixelFormat* format, Uint32* colorArray, Uint16 startIndex, Uint16 stopIndex)
- Fills the given array from startIndex to stopIndex with a black and white palette.


SPriG v1.0.0 Documentation by Jonathan Dearborn 2008