typedef struct tagRGBQUAD {
BYTE rgbBlue;
BYTE rgbGreen;
BYTE rgbRed;
BYTE rgbReserved;
} RGBQUAD;
Specifies a logical color or a 16-bit color index. A logical color specifies the color desired by an application. A color index indirectly specifies a logical color by identifying a color in an array (or table) of colors.
When the colors are at minimum intensity (0, 0, 0), the result is black; when at maximum intensity (255, 255, 255), the result is white; and when at half intensity (127, 127, 127), the result is gray.
Primary colors can be combined to form new colors. For example, solid red (0, 0, 255) and blue (255, 0, 0) can form purple (255, 0, 255). If a device cannot display all the possible RGB color combinations, the device driver must map given RGB color values to colors the device can display. For example, for a black-and-white display with only one bit per pixel, the driver uses a cutoff intensity at which all the RGB values above the intensity are white and all below are black. One method used to compute the cutoff intensity is to add the individual color intensities according to the following formula:
((5*rgbGreen+3*rgbRed+rgbBlue)+4)>>3
If the result is greater than 128, then all the RGB values above that intensity will be white, and those below it will be black.