In "Why were those colors chosen to be the default palette for 256-color VGA?", we've established that 216 of its colors represent a 24x3x3 truncated HSV color space.

This results in an inconsistent perceptual distance, so custom palettes were prevalent in commercial apps. However, one answer points out that VGA default palette's HSV allows for some cheap computations: desaturating or dimming colors by simply adding 24 or 72.

Was that feature used in any practical application?

I'm interested in finding if any video game, engine, graphics software, middleware, or any other commercial or open-source application (more than a personal training project), performed any effects by doing math with color numbers in the palette. It would be most interesting to see it done with the default VGA palette.

As a second choice, any applications that performed effects through shifting color # in a custom palette that similarly represented a color model. As opposed to doing it in RGB and mapping to the palette, or using preset sprites, or changing the palette itself.

  • 2
    Dimming or brightening was usually achieved by changing the palette instead of changing the pixel values (because changing the palette is a lot faster), so may guess would be: no, adding/subtracting 24 or 72 was not used in practice.
    – dirkt
    Commented Nov 9, 2023 at 5:20
  • 2
    @Therac-StandwithPalestine Do demos and intros count? I am positive they have used every known trick in the books and even beyond that. It is not a difficult concept of choosing the palette so that you can have different saturation and luminance values for a range of hues, so by adding some offsets you can dim/bright a blob on screen for example.
    – Justme
    Commented Nov 9, 2023 at 11:18
  • 1
    Can you clarify whether or not you're asking about the default VGA palette specifically, or if your question includes custom 256 colour palettes where user-defined mathematical relationships between colour groups hold?
    – knol
    Commented Nov 9, 2023 at 12:53
  • 1
    @Raffzahn I'm using "hack" in a positive sense, as a clever way to do things faster. But let's call it math properties. I didn't want to create an even longer discussion around your answer, and decided a separate question is better to see if it was a useful feature.
    – Therac
    Commented Nov 9, 2023 at 15:04
  • 1
    If custom palettes are included, then the question is, has anyone ever organized at least a part of a color palette so that math operations on color index numbers have a sensible meaning. And the answer is of course yes. If you place grays in order from darkest to brightest and not randomly, then increasing the color index increases brightness. I'm pretty sure someone has arranged their grays non-randomly at least once. Commented Nov 10, 2023 at 10:16

2 Answers 2


I don't think it's the same palette, but XCom/UFO used a palette composed of the same colors at different brightnesses so that it could do dynamic lighting with it. I think this may have been a pretty common technique since I think Quake did something similar much later, being designed for a fixed 256-color palette.

  • Now, Quake is interesting... Being a 3D game, I recall not even realizing it was in 256 colors. Would be great to look into what exactly it did.
    – Therac
    Commented Nov 12, 2023 at 18:23
  • 2
    Actually, Quake does not count for sure. Given Quake being such an advanced game; it did not use a specially arranged palette to do the trick directly, but a separate look-up table for mapping the required colour&brightness value into the fixed 256-color palette, which means, the 256 colors of the VGA could in theory be in any order because it does not matter how the look-up points to them as long as it works. The look-up table was about 16k entries in length to allow for 64 shades for each of the about 256 source colors.
    – Justme
    Commented Nov 13, 2023 at 6:23
  • So Quake used a sort of double-palette system? Because the original software renderer definitely ran in 256 colors unless you improved the settings with winquake or similar.
    – davolfman
    Commented Nov 13, 2023 at 21:26
  • 2
    @davolfman No, Quake used a single fixed palette of 256 colors (if you don't count the effect of being hit etc). When you needed to draw a source pixel of original texture (0..255) with amount of light (0..63) applied to it, there is a look-up-table that can map those two values into to one of the 256 VGA colour indexes to write a pixel to video RAM.
    – Justme
    Commented Nov 13, 2023 at 21:46

I would believe the question is not really answerable the way it is.

For one,the default palette is a manufacturer side offering, as such intended for low effort application, the ones that do not take the extra step to create an application specific one - or an optimized one for each picture.

Any product of reasonable size or task to make sales worthwhile would have, at DOS times, done its own palettes. This is especially true for demos which usually would use the ability to program the palette for effect. A possible exception could be some build to comply with extreme limitations, like boot sector demos/games.

It doesn't work asking for a use of a certain feature but excluding the class of applications that might use them. Adding statements like 'gap between bright and dim' does not really support the search.

  • I wouldn't say any demo. There are sometimes (very) size restricted competitions. Like boot sector games or demos.
    – BlackJack
    Commented Nov 9, 2023 at 17:55
  • @BlackJack Good point. I should have added that as possibleexception.
    – Raffzahn
    Commented Nov 9, 2023 at 21:33
  • It's not possible to prove a negative. But any one example of any application using this technique would be a positive answer.
    – Therac
    Commented Nov 10, 2023 at 9:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .