Reference · Editing

pxart recolor

Repaint, swap or rename palette keys in frames ('a=b', 'a<>b', 'a>b'), or give a key a new color.

recolor FILE a=b ['a<>b'] ['a>b'] [c=#rrggbb] [-o OUT] [--region x,y,w,h] [--variant V]
usage: pxart recolor [-h] [-o O] [--region REGION] [--variant V] [--dry-run] file maps [maps ...]

  recolor FILE a=b ['a<>b'] ['a>b'] [c=#rrggbb] [-o OUT] [--region x,y,w,h] [--variant V]
      Repaint, swap or rename palette keys in frames ('a=b', 'a<>b', 'a>b'), or give a key a new color.

positional arguments:
  file
  maps

options:
  -h, --help       show this help message and exit
  -o O
  --region REGION
  --variant V      c=#hex sets c's color in variant V (it must exist), not the base, and 'b>t' t=#hex gives the new key t a V color of its own; key moves repaint pixels, the same in every variant
  --dry-run        print what the edit says and a diff of the file it would change; write nothing

      a=b repaints key a's pixels as key b (optionally only inside --region); 'a<>b' swaps
      keys a and b (in the region) in one step; quote it: unquoted < and > are shell
      redirections. 'a>b' gives a's pixels a new key b, in a's color (and a's variant
      colors): when no pixel keeps a and a is FILE's own key, a's palette lines become b's
      (a rename), else b is added and a stays: it frees a key without a visible change;
      onto a key b already in a's color (a near-duplicate), the error says to write a=b, a repaint that
      looks the same. c=#hex changes key c's color everywhere. '.' works as a source key.
      Order: the key moves of one call apply together, each pixel by the key it had before
      the call, so no move feeds another: 'a<>b' c=a turns a's pixels to b and b's and c's
      to a, and a=b b=a is a swap too. The renames apply together as well: a key another
      'a>b' of the call renames away is free for a new key, so 'g>r' 'd>g' renames g to r and
      d to g, and 'a>b' 'b>a' swaps two keys' names (every pixel keeps its look). A key the
      call keeps (pixels outside --region or the selection draw with it, it is imported, or
      c=g paints with it) isn't free. A key moved twice is E_BAD_ARG. Color changes (V's:
      --variant V) set the palette, moving no pixels: c=#hex, c=d and 'b>t' t=#hex share a
      call.

See also, in pxart help all: FORMAT: variants (@variant, %VARIANT); EDITING (-o OUT gets the
  whole file, only changed lines are rewritten, 'no change'); FORMAT: selecting frames
  (FILE:SEL, an unnamed grid's name, zsh's "${F}:sel").

pxart help all has the whole reference, pxart help TOPIC one part of it.

This is the output of pxart help recolor. The other editing commands and their shared notes are in pxart help EDITING.

This page is built from site/src/data/reference.json in the repository.Edit on GitHub