C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Graphics Mode Colors
                                             Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The default colors (defined in GRAPH.H) for color text or a
     16-color graphics mode are shown below:
 
     Index   Constant      Index   Constant
 
     0       _BLACK        8       _GRAY
     1       _BLUE         9       _LIGHTBLUE
     2       _GREEN        10      _LIGHTGREEN
     3       _CYAN         11      _LIGHTCYAN
     4       _RED          12      _LIGHTRED
     5       _MAGENTA      13      _LIGHTMAGENTA
     6       _BROWN        14      _YELLOW
     7       _WHITE        15      _BRIGHTWHITE
 
     In the long value specification of a color, the lower three bytes
     represent the three component colors: red, green, and blue.
 
     Each of the three bytes represents the intensity of one of the
     red, green, or blue component colors, and must be in the range
     0-31. In other words, the low-order six bits of each byte specify
     the component's intensity and the high-order two bits should be
     zero. The fourth (high-order) byte in the long is unused and
     should be set to zero. The diagram below shows the ordering of
     bytes within the long value.
 
          blue byte     green byte     red byte
          00BBBBBB      00GGGGGG       00RRRRRR
          high ----------------------> low order
 
     The EGA supports only 64 different colors. Color values for EGA
     are specified in exactly the same way as for the VGA. However, the
     four low-order bits of each byte are simply ignored.
 
     If a VGA or MCGA adapter is connected to an analog monochrome
     monitor, the color value is transformed into its gray-scale
     equivalent, based on the weighted sum of its red, green, and blue
     components (30% red + 50% green + 11% blue).
                                    -♦-