Represents the palette of a surface
class SDLPalette
colors | MemBuf of 4 byte elements containing each color entry |
ncolors | number of elements in the palette (equal to colors |
GetColor() | Gets a color in the image palette. |
SetColor() | Sets a color in the image palette. |
MemBuf of 4 byte elements containing each color entry
number of elements in the palette (equal to colors
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. | ||
Returns: | an array containing red, green and blue elements. | ||
Raises: |
|
An array can be provided as parameter to prevent re-allocation of the returned value.
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). | ||
Raises: |
|
Changes a value in the image palette