Palette
paletteManage a sprite's color set before drawing: inspect existing colors with usage counts, replace or merge colors, load presets or files, generate shadow/highlight ramps, and detect off-palette colors.
Instructions
Read and shape the sprite's palette. Ops: • 'get' — current palette with per-colour usage counts. • 'set' — write specific indices, or replace the palette wholesale. • 'preset' — load a bundled palette (pico8, gameboy, gameboy-pocket, cga, 1bit, grayscale-8). • 'load' — read a .gpl/.hex/.pal/.png palette file from disk. • 'ramp' — generate a hue-shifted ramp from a base colour and append it. Shadows rotate toward blue, highlights toward orange; a ramp that only changes brightness is the clearest tell of machine-made pixel art. • 'analyze' — report ramp structure, contrast, near-duplicate entries and colours used in the art that are not in the palette. Decide the palette before drawing. Retro-fitting one onto finished art means repainting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | ||
| base | No | Base colour for op 'ramp'. | |
| path | No | Palette file for op 'load'. | |
| steps | No | Ramp length. | |
| colors | No | For op 'set': the colours to write. | |
| preset | No | Preset key for op 'preset'. | |
| spread | No | How far the ramp reaches into shadow and light. | |
| sprite | No | Sprite filename or id. Omit to use the sprite Aseprite has focused. | |
| replace | No | For op 'set'/'preset': replace the whole palette instead of merging. | |
| remapArt | No | When replacing a palette, repaint existing pixels to the nearest new colour instead of leaving them off-palette. | |
| startIndex | No | For op 'set': where `colors` starts. Ignored when `replace` is true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | ||
| ramp | No | ||
| size | No | ||
| usage | No | ||
| colors | No | ||
| sprite | No | ||
| analysis | No | ||
| availablePresets | No |