Palette
ase.Palette (Class)
Static Members
Default palette used by Aseprite when a new file is created
createDefault(): Palette
Returns |
---|
Palette |
Create a palette from an array of RGBA values
Name | Type |
---|---|
rgba |
Array<Int> |
Returns |
---|
Palette |
fromChunk(chunk: ase.chunks.PaletteChunk): Palette
Create palette from Palette Chunk (0x2019)
Name | Type |
---|---|
chunk |
ase.chunks.PaletteChunk |
Returns |
---|
Palette |
fromOldChunk(chunk: ase.chunks.OldPaleteChunk): Palette
Create palette from Old Plaette Chunk (0x0004)
Name | Type |
---|---|
chunk |
ase.chunks.OldPaleteChunk |
Returns |
---|
Palette |
Instance Members
entries: Array<PaletteEntry>
numColors: Int
firstIndex: Int
Deprecated: No reason to use this. First index will always be 0
lastIndex: Int
Deprecated: No reason to use this. Last index will alway equal to entries.length - 1
getEntry(index: Int): PaletteEntry
Deprecated: One can just use palette.entries[index]
instead
Name | Type |
---|---|
index |
Int |
Returns |
---|
PaletteEntry |
Name | Type |
---|---|
index |
Int |
Returns |
---|
Int |
Name | Type |
---|---|
index |
Int |
Returns |
---|
Int |
toChunk(): ase.chunks.Chunk
Creates the Old Palette Chunk (0x0004) if there are fewer than 256 colors in the palette and no alpha channel (all alpha values are 0xff). Otherwise, creates the Palette Chunk (0x2019).
Returns |
---|
ase.chunks.Chunk |
Private Members
new(entries: Array<PaletteEntry>): Void
Name | Type |
---|---|
entries |
Array<PaletteEntry> |
Metadata
Name | Parameters |
---|---|
:hxGen |
- |