The 20 reserved colors


The following table contains a list of the 20 colors that Windows reserves in the system palette to paint buttons, icons,... A system palette is only used in the 256-colors display mode so, of course, this table only applies for this mode. Note that exactly the same colors at exactly the same positions are used in an identity palette (see Palettes in Windows). The index statement is given as a decimal value, the value statement is the hexadecimal RGB-value of the color (the first two digits represent the red value, the third and fourth digit the green value and the fifth and sixth digit represent the blue value).
index value color
0 0x000000  
1 0x800000  
2 0x008000  
3 0x808000  
4 0x000080  
5 0x800080  
6 0x008080  
index value color
7 0xC0C0C0  
8 0xC0DCC0  
9 0xA6CAF0  
/\/\/\/\ /\/\/\/\/\/\/\ /\/\/\/\
246 0xFFFBF0  .
247 0xA0A0A4  
248 0x808080  
index value color
249 0xFF0000  
250 0x00FF00  
251 0xFFFF00  
252 0x0000FF  
253 0xFF00FF  
254 0x00FFFF  
255 0xFFFFFF  
The colors are divided into two parts and arranged at the start and the end of the palette to provide a possibility to invert the system colors in a way that makes sense. In a truecolor display a pixel is simply inverted by inverting the literal RGB value of the pixel, for example: if a pixel has the RGB value 00FF00 it would be inverted to FF00FF. This method is also used for the 256 color mode. But the problem is that if you invert a 256-color byte that points to an entry in a palette you can never be sure to which color (in the palette) the inverted palette pointer will point to, actually it could be exactly the same color. An example: a byte in a 256-color bitmap contains the value A3 (points to palette entry A3: light blue); this would be inverted into 5C (FF-A3=5C; points to palette entry 5C: contains another light blue). This way it sometimes occurs that a 256 color bitmap isn't inverted usefully.

Back to the main page



Copyright 1998 Stefan Hetzl. If you have questions or comments or have discovered an error, send mail to [email protected]. You may forward this document or publish it on your webpage as long as you don't change it and leave this notice at the end.