Enhanced Graphics Adapter - Color Palette

Color Palette

The EGA palette allows all 16 CGA colors to be used simultaneously, and it allows substitution of each of these colors with any one from a total of 64 colors (two bits each for red, green and blue). This also allows the CGA's alternate brown color to be used without any additional display hardware. The later VGA standard built on this by allowing each of the 64 colors to be further customized.

When selecting a color from the EGA palette, two bits are used for the red, green and blue channels. This allows each channel a value of 0, 1, 2 or 3. To select the color magenta, the red and blue values would be medium intensity (2, or 10 in binary) and the green value would be off (0). When calculating the intended value in the 64-color EGA palette, the binary number of the intended entry is of the form "rgbRGB" where a lowercase letter is the least significant bit of the channel intensity and an uppercase letter is the most significant bit. For magenta, the most significant bit in the red and blue values is a 1, so the uppercase R and B placeholders would become 1. All other digits are zeros, giving the binary number 000101 for the color magenta. This is 5 in decimal, so setting a palette entry to 5 would result in it being set to magenta. All the color values for the default colors are listed in the table on the right.

Default EGA 16-color palette
(set up to match the standard CGA colors)
Color rgbRGB Decimal
0 – black (#000000) 000000 0
1 – blue (#0000AA) 000001 1
2 – green (#00AA00) 000010 2
3 – cyan (#00AAAA) 000011 3
4 – red (#AA0000) 000100 4
5 – magenta (#AA00AA) 000101 5
6 – brown (#AA5500) 010100 20
7 – white / light gray (#AAAAAA) 000111 7
8 – dark gray / bright black (#555555) 111000 56
9 – bright blue (#5555FF) 111001 57
10 – bright green (#55FF55) 111010 58
11 – bright cyan (#55FFFF) 111011 59
12 – bright red (#FF5555) 111100 60
13 – bright magenta (#FF55FF) 111101 61
14 – bright yellow (#FFFF55) 111110 62
15 – bright white (#FFFFFF) 111111 63

Read more about this topic:  Enhanced Graphics Adapter

Famous quotes containing the words color and/or palette:

    Surely the day will come when color means nothing more than skin tone, when religion is seen uniquely as a way to speak one’s soul; when birth places have the weight of a throw of the dice and all men are born free, when understanding breeds love and brotherhood.
    Josephine Baker (1906–1975)

    The great God endows His children variously. To some he gives intellect—and they move the earth. To some he allots heart—and the beating pulse of humanity is theirs. But to some He gives only a soul, without intelligence—and these, who never grow up, but remain always His children, are God’s fools, kindly, elemental, simple, as if from His palette the Artist of all had taken one color instead of many.
    Mary Roberts Rinehart (1876–1958)