PLAYPAL

The PLAYPAL lump is a collection of palettes used by the Doom engine for displaying color fading and tinting effects. Since the engine can only display a maximum of 256 simultaneous colors, in order to achieve these effects, the palettes must be swapped, thus changing the colors displayed on the screen. Each palette in the PLAYPAL lump contains 256 colors totaling 768 bytes, where each color is broken into three unsigned bytes. Each of these color components (red, green, and blue) range between 0 and 255.

The COLORMAP resource also affects the display of colors on screen.

Doom
The Doom PLAYPAL contains a total of 14 palettes, where each palette has a specific function: An examination of the Doom source code reveals that the unused palettes (1 and 9) were likely intended to be the first levels of the red and yellow tinting effects, but because of the logic used in the palette code, they are never used: if (cnt) { 	palette = (cnt+7)>>3; if (palette >= NUMREDPALS) palette = NUMREDPALS-1; palette += STARTREDPALS; }   else if (plyr->bonuscount) { 	palette = (plyr->bonuscount+7)>>3; if (palette >= NUMBONUSPALS) palette = NUMBONUSPALS-1; palette += STARTBONUSPALS; } Since the computer palette will always be at least 1 + START[RED|BONUS]PALS, the first palette is skipped. This could have been fixed subtracting 1 while adding the STARTPAL (and therefore not while capping the palette).

The precise algorithm used to tint the palettes can be found in dcolors.c, a part of the Doom utilities.

Tools which can be used to manipulate the PLAYPAL include Inkworks, DeePsea and SLADE 3.

Heretic
Heretic's PLAYPAL is laid out identically to Doom's, using the same generator. The "radiation suit" palette is present despite not being used.

Hexen
In Hexen, the engine uses an extended PLAYPAL lump containing 28 palettes, of which the additional palettes are used for several new effects.

Strife
Strife's PLAYPAL is laid out identically to Doom's. The radiation suit palette is used for poisoning effects from certain types of damaging floors. With the way this effect is implemented in Strife, the palette change happens before damage starts being inflicted, serving as a warning to the player.

Index 247
Many specialized editing tools (notably NWT, SLumpEd and XWE) rely on the assumption that palette index 247 is not used and can safely be used as a "transparent color", which they display as cyan because it contrasts well with the rest of the Doom palette. This assumption, however, is incorrect. Palette index 247 is used by some Doom II graphics, and it is black (0, 0, 0), not cyan. All 256 colors of the palette are shown in the patches and sprites picture format, as a different mechanism for transparency is used. Palette index 247 is used even more in other Doom engine games such as Hexen. The mistaken assumption created by having these tools treating cyan as a transparent color when importing pictures and converting them to Doom-format graphics, or by giving transparency to pixels indexed 247 when exporting, results in many problems: patches and sprites exported from the IWADs might have "holes" that they shouldn't have, and attempts to actually use cyan as a color in graphics (with a palette that does contain this color) are hindered.

Source

 * This article incorporates information from the Unofficial Doom Specs, from the Doom utilities source code, and from analyses performed with SLADE 3.