Palettes - itb-community/ITB-ModLoader GitHub Wiki
Table of Contents
- modApi
modApi
addPalette
void modApi.addPalette(palette)
| Argument name | Type | Description |
|---|---|---|
palette |
table | A table with fields describing the palette being added |
The palette object, passed as first argument, has the following necessary fields:
| Field | Type | Description |
|---|---|---|
colorMap |
table | A list of 8 colors defining the palette |
The palette object can have the following additional optional fields:
| Field | Type | Description |
|---|---|---|
id |
string | The id of the palatte |
name |
string | The name of the palette |
image |
string | The image used to display the palette |
Adds a palette to the game, usable by any squad.
The colorMap must contain the following fields:
| Field | Type | Description |
|---|---|---|
lights |
table | The color usually reserved for eyes and lights |
main_highlight |
table | The brightest color in the main color ramp |
main_light |
table | Next brightest color in the main color ramp |
main_mid |
table | Next darkest color in the main color ramp |
main_dark |
table | Overall the darkest color, often used to end the main and metal color ramps |
metal_dark |
table | Darkest color in the metal color ramp. main_dark is often used to go below this |
metal_mid |
table | Next brightest color in the metal color ramp |
metal_light |
table | Brightest color in the metal color ramp |
Each table in the colorMap is a 3 length list of three numbers for red, green and blue. i.e: { red, green, blue }
canAddPalettes
boolean modApi.canAddPalettes()
Returns true if palettes can be added, or false if they can't.
Palettes can't be added after mods have finished initialization.
getCurrentPaletteOrder
table modApi.getCurrentPaletteOrder()
Returns a list of all palettes, ordered by how they are arranged on the Palette Screen.
Main Menu > Mod Contents > Palettes
getDefaultPaletteOrder
table modApi.getDefaultPaletteOrder()
Returns a list of all palettes, ordered by the time they were added by mods.
getPalette
table modApi.getPalette(id)
| Field | Type | Description |
|---|---|---|
id |
string | The id of the palatte |
Returns the palette with the specified id.
In order to more easily find your palette, you can give your palette a unique id when adding it.
getPaletteImageOffset
table modApi.getPaletteImageOffset(id)
| Field | Type | Description |
|---|---|---|
id |
string | The id of the palatte |
Returns the image offset for the palette with the specified id.
Pawns has a field ImageOffset specifying which palette is used to color them.
In order to more easily find your palette, you can give your palette a unique id when adding it.