ramp_from_art
Recover the ordered color ramp from an existing sprite, grouped by luminance into steps, so you can shade or extend art that matches the original palette.
Instructions
Recover the ramp an existing sprite is painted with.
`extract_palette` reports the colours a sprite uses as a set. A set is not a ramp: the
shading tools need them ordered dark to light, and an agent asked to add to somebody
else's sprite has no way to get that order today.
The colours are grouped by luminance into `steps` bands, and each band is represented
by the colour most of its pixels use, so every entry is a colour that is actually in
the art and can be matched against it. `coverage` says what share of the drawn pixels
each step covers, which is how to tell a real ramp from one step plus four stragglers.
Says so when the colours are not a ramp: art spanning many hues is several materials
sharing a sprite, and comes back with a warning rather than with a plausible-looking
five colours. Scope the read with `layer` when that happens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frame | No | Default: 1. | |
| layer | No | ||
| steps | No | Default: 5. | |
| filename | Yes |