Optionalresolve: (name: string) => number | undefinedimport { parsePaletteLists, parseImagePath, imageModifier } from '@datamoc/mw_games/two-d/render';
const pal = imageModifier(parseImagePath('unit.png~PAL(ff0000,00ff00>0000ff,ffff00)'), 'PAL')!;
console.log(parsePaletteLists(pal.args)); // { from: [0xff0000, 0x00ff00], to: [0x0000ff, 0xffff00] }
~PAL(a,b,c>x,y,z)'s two comma-separated colour lists, one per side of a single>. The modifier's own args have already been comma-split byparseImagePathbefore this runs (the same naive split every modifier's argument list goes through), soa,b,c>x,y,zarrives as the four separate tokens['a', 'b', 'c>x', 'y', 'z']- rejoining them with,recovers the original text before this does its own split on>and then,, rather than assuming the list boundary landed on an argument boundary the way a naiveargs[0]/args[1]read would.