IT lexicon › Programming › Palette fade

Palette fade

Programming På svenska → Updated: 2026-10-26

Fading the whole screen to black, white or any colour by recalculating the palette frame by frame and nothing else.

With indexed colour every pixel points at a palette slot, not a colour. Scale all the palette's RGB values down a notch each frame and the entire image darkens at once — without touching a single byte of video memory. On a PC in Mode 13h that meant 768 writes to the VGA card's DAC, which only had six bits per channel and so 64 steps. The writes went in during VBlank to avoid snow halfway down the screen.

The NES had no palette arithmetic at all, but its colour table was arranged in brightness rows: subtracting 16 from an index moved a colour one row darker, and four such steps reached black. That is why NES fades come in such obvious stair-steps. A cousin of palette cycling, which rotates colours instead of dimming them.

← Back to the lexicon