local palette = Palette()
local palette = Palette(numberOfColors)
local palette = Palette(otherPalette)
local palette = Palette{ fromFile=filename }
local palette = Palette{ fromResource=resourceID }Creates a new palette. By default it will contain 256 colors, but you
can specify a numberOfColors (integer value).
otherPalette can be another palette object to create a copy of it.
If fromFile is given, the palette is loaded from the file name.
If fromResource is given, the resourceID is an ID specified in one
of the extensions
palette
(e.g.
DB16,
DB32,
Solarized).
local ncolors = #paletteReturns the number of colors in the palette (remember that valid indexes in the palette go from 0 to ncolors-1).
palette:resize(ncolors)Changes the number of the palette colors to ncolors (an integer
value).
local color = palette:getColor(index)Returns the color in the given entry index (the index goes from 0 to #palette-1).
palette:setColor(index, color)Changes a palette color in the given entry index (the index goes from 0 to #palette-1).
The color can be a Color object or an integer pixel value.
At the moment it will always return the first frame, but in the near future Aseprite will support palette changes over time (in different frames), so this field should be the frame number where the palette is displayed for the first time in the sprite.
palette:saveAs(filename)Saves the palette in the given filename.