Skip to content

Palettes and Remaps

pchote edited this page Apr 28, 2011 · 15 revisions

OpenRA loads native ra/cnc palettes which are a list of 256 colors in a custom format (TODO: explain the color format).

Certain color indices have hard-coded meanings as transparent or shadow colors. Index 0 is mapped to transparent. If the Transparent flag (explained below) is true, indices 1 and 3 will be mapped to a light shadow color and index 4 to a darker shadow color.

Palette Traits

Palettes must be defined with a trait before they can be used ingame. The Name field is used both by internal palette lookups, and by custom palette overrides on unit Render* traits.

The following traits can be added to the World actor:

PaletteFromFile@chrome:
	Name: <string>                    # Internal palette name
	Filename: <string>                # Filename to load
	Tileset: <string, default null>   # If defined, load the palette only for this tileset
	Transparent: <bool, default true> # Map indices 1,3,4 to shadow if true

This is the most basic palette definition.

PaletteFromCurrentTileset:
	Name: <string>                    # Internal palette name
	Transparent: <bool, default true> # Map indices 1,3,4 to shadow if true

This trait loads the palette specified in the current tileset definition.

PaletteFromRGBA:
	Name: <string> # Internal palette name
	R: <0-255>     # Red color component
	G: <0-255>     # Green color component
	B: <0-255>     # Blue color component
	A: <0-255>     # Alpha color component

This trait creates a single color palette without any base palette file. This is used to define the palettes for iron curtain and low-power.

ShroudPalette:
	Name: <string> # Internal palette name
	IsFog: <bool>  # True for for, false for shroud

This trait adds the hard-coded fog and shroud palettes to the game.

Player palettes work slightly differently to the other palette definitions. The PlayerColorPalette trait is added to the Player actor definition.

PlayerColorPalette:
	BasePalette: <string>                # The Name of the palette to base off
	BaseName: <string, default `player'> # The prefix for the resulting player palettes
	PaletteFormat: <enum: ra|cnc|d2k>    # Remap style, see below

This trait takes the specified base palette and remap style, and creates a palette for each player in the game using the color they chose in the lobby.

Player color remaps

OpenRA supports remappable ranges for player colors, supporting ra,cnc, and d2k style palettes.

  • ra: A ramp of 16 colors, starting at index 80
  • d2k: A ramp of 16 colors, starting at index 240
  • cnc: Two ramps of 8 colors each, starting at index 176. One ramp is used for buildings, the other for units.

Players ๐ŸŽฒ

Modders โœ๏ธ

Developers ๐Ÿ”ง

Clone this wiki locally