Class SDLPalette[in The SDL Falcon Module.]

Represents the palette of a surface

class SDLPalette

Summary

colorsMemBuf of 4 byte elements containing each color entry
ncolorsnumber of elements in the palette (equal to colors
GetColor()Gets a color in the image palette.
SetColor()Sets a color in the image palette.

Properties

colors

MemBuf of 4 byte elements containing each color entry

ncolors

number of elements in the palette (equal to colors

Methods

GetColor()

Gets a color in the image palette.

SDLPalette.GetColor( colorIndex, [colArray] )

colorIndexIndex of the color in the palette.
colArrayArray of that will hold red, green and blue values.
Returns:an array containing red, green and blue elements.
Raises:
RangeErrorif color index is out of range.

An array can be provided as parameter to prevent re-allocation of the returned value.

SetColor()

Sets a color in the image palette.

SDLPalette.SetColor( colorIndex, red, [green], [blue] )

colorIndexIndex of the color in the palette.
redthe Red value of the color to be set, or a three elements array with the three color values.
greenGreen value of the element (not needed if red was an array).
blueBlue value of the element (not needed if red was an array).
Raises:
RangeErrorif color index is out of range.

Changes a value in the image palette


Made with faldoc 2.0.0