Package-level declarations
Types
An opaque colour stored in JSON as #rrggbb.
A project's palette: the opaque colours every draft is drawn in, in the order the palette file lists them. At most MAX_COLORS: an indexed .ase holds 256 entries, and the handoff keeps one of them for transparency.
Appends a colour to a project's palette file, after the colours already there. Only a .hex palette with room for one more colour, and without that colour, can take it; unavailableReason says which of these fails, in words fit to show the artist. A palette file that cannot be read or written is an java.io.IOException.
Reads a Palette from the two plain-text formats pixel artists share palettes in, told apart by the file's extension, and writes one as .hex:
A palette file that is malformed, of an unknown kind, or not a valid Palette.
Maps a raster onto a Palette: each pixel at least half opaque takes the palette colour nearest to it in OKLab, the first on a tie, written as a palette label (index plus one); every other pixel is 0, background. How a reference photo becomes something an indexed sprite can hold.
A project's palette and its ramps, checked against each other: every ramp colour, and the outline colour if there is one, is a palette colour. So whatever a draft is shaded or outlined in can be written into the indexed handoff.
A named run of palette colors from darkest to lightest, as the artist shades one material: skin, cloth, metal. Shading picks a step by lightness, so the colours must grow strictly lighter in OKLab; the first is the darkest, which also outlines the ramp's regions.
Builds a Ramp from the colours the artist picked: sorts them dark to light by OKLab lightness, so the order they were clicked in does not matter, and says in plain words why a pick cannot be a ramp. Every failure is an IllegalArgumentException whose message is fit to show the artist.
A project's ramps.json: its named ramps and, optionally, the outline colour drafts are outlined in. Without one, each region is outlined in its own ramp's darkest colour.
Reads and writes a project's ramps.json as a RampSet.
A ramps.json that is malformed, fails RampSet's validation, or uses colours its palette lacks.
Suggests ramps for a Palette: a deterministic starting point the artist then edits.