Skip to content

Palette

sirrandalot edited this page Mar 8, 2018 · 1 revision

Palette is a class representing a colour palette. It can not be instantiated direction, you must use PaletteFactory to create Palettes.
It uses integers following the format to represent colours:

0x00RRGGBB

so a bright magenta for example could be written as

Integer.parseUnsignedInt("00FF00FF", 16)

Methods:

int getNumColours()

  • Gets the number of colours in the Palette.

int getColourAt(int index)

  • Gets the colour at the specified index.

setColourAt(int index)

  • Sets the colour at the specified index.

addColour(int colour)

  • Adds a given colour to the end Palette.

Clone this wiki locally