PaletteContainer

Defines palette handling functions. It provides various functions for safe palette handling.

Members

Functions

addPaletteChunk
Color[] addPaletteChunk(Color[] paletteChunk)

Adds a palette chunk to the end of the main palette.

clearPaletteChunk
Color[] clearPaletteChunk(ushort lenght, ushort offset)

Clears an area of the palette with zeroes. Returns the original area.

getPaletteIndex
Color getPaletteIndex(ushort index)

Returns the given palette index.

loadPalette
Color[] loadPalette(Color[] palette)

Loads a palette into the object. Returns the new palette of the object.

loadPaletteChunk
Color[] loadPaletteChunk(Color[] paletteChunk, ushort offset)

Loads a palette chunk into the object. The offset determines where the palette should be loaded. If it points to an existing place, the indices after that will be overwritten until the whole palette will be copied. If it points to the end or after it, then the palette will be made longer, and will pad with values #00000000 if needed. Returns the new palette of the object.

setPaletteIndex
Color setPaletteIndex(ushort index, Color value)

Sets the given palette index to the given value.

Properties

palette
Color[] palette [@property getter]

Returns the palette of the object.

Meta