Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

COL Palette File Format

256-color RGB palette format.

Each file maps color indices (0–255) to RGB values. Models reference palette entries via color_index in solid-color face data (see 3D.md).

Overall Structure

All COL files are exactly 776 bytes.

OffsetSizeTypeNameDescription
0x004u32file_sizeAlways 776.
0x044u32magicAlways 0x0000B123.
0x08768[u8; 768]palette256 × RGB triplets (3 bytes each, values 0–255).

Palette entry N is at offset 8 + N × 3, yielding bytes (R, G, B).

Usage

COL files are per-scene, not per-model. Different levels use different palettes (e.g. ISLAND.COL, CATACOMB.COL). The same color_index in a model’s face data produces different colors depending on which palette is active.

Entry 0 is always (0, 0, 0) — black.

  • TEXBSI — the CMAP subrecord in animated TEXBSI images uses the identical 256 × RGB triplet layout (768 bytes). CMAP palettes are embedded per-image; COL palettes are per-scene.
  • FNT — font files embed their own BPAL/FPAL palettes (same 768-byte layout), independent of scene COL palettes.

Redguard Preservation CLI

The convert command exports a COL file as two companion files:

  • Swatch PNG — 256×256 image with a 16×16 grid of color swatches (16 px per cell). Index 0 is top-left, 255 is bottom-right, row-major order.
  • Palette JSON — structured metadata with per-entry index, r, g, b (0–255), and hex fields. Versioned as redguard-col-v1.

The output path determines the primary filename; the companion file shares the same stem with the other extension. Passing -o ISLAND.png produces ISLAND.png + ISLAND.json; passing -o ISLAND.json produces the same pair.

External References