18.9Class SDLPalette

Represents the palette of a surface

Class SDLPalette
Properties
colors MemBuf of 4 byte elements containing each color entry.
ncolors number of elements in the palette (equal to colors.
Methods
GetColorGets a color in the image palette.
SetColorSets a color in the image palette.

Properties

colors

MemBuf of 4 byte elements containing each color entry.

MemBuf of 4 byte elements containing each color entry.

ncolors

number of elements in the palette (equal to colors.

number of elements in the palette (equal to colors.len() )

Methods

GetColor

Gets a color in the image palette.

SDLPalette.GetColor( colorIndex, [colArray] )
colorIndex Index of the color in the palette.
colArray Array of that will hold red, green and blue values.
Returnan array containing red, green and blue elements.
Raise
RangeError if 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] )
colorIndex Index of the color in the palette.
red the Red value of the color to be set, or a three elements array with the three color values.
green Green value of the element (not needed if red was an array).
blue Blue value of the element (not needed if red was an array).
Raise
RangeError if color index is out of range.

Changes a value in the image palette

Made with http://www.falconpl.org