trick/palbuilder

    Dark Mode
Search:
Group by:

↩ back to overview

Procs

proc toPalette(palSet: IntSet): GfxPalette {...}{.raises: [], tags: [].}
Convert an IntSet to a list of 15-bit colors, while ensuring that the trasparent color (clrEmpty) is always first.
proc toIntSet(pal: GfxPalette): IntSet {...}{.raises: [], tags: [].}
Convert a list of colors to an IntSet, for efficient comparison and merging.
proc reducePalettes(tilePals: seq[IntSet]): tuple[mergedPals: seq[GfxPalette],
    palNums: seq[int]] {...}{.raises: [], tags: [].}
Given a list of individual palettes for each tile in the map Merge these down into a set of palettes and a list of indexes
proc joinPalettes(mergedPals: seq[GfxPalette]): GfxPalette {...}{.raises: [],
    tags: [].}

Build a master palette bank from a set of 16-color palettes.

If a palette has less than 16 colors, it will be padded. If a palette has more than 16 colors, it will be truncated.