Most display devices on the market today enable the programmer to access upwards of 16.8 million colors, using 24-bit color. However, in many cases, the device can display only 256 of these 16.8 million colors on the screen at any one time. This is where a "palette" comes into play.A display device of this type will maintain a hardware (or system) palette of 256 entries from which applications can draw upon and display 256 colors. When the program changes an entry in the palette, any pixel on the screen using that palette entry will also change.
On a palette-oriented display device, the mapping of 8-bits-per-pixel data to the 256 colors in the palette, can be done as an indexing operation. Figure 1 shows how the 8-bit data value in a bitmap acts as an index into the system palette. The display driver will then retrieve and use that palette entry to produce the proper color for that bit of data.