RGB

  COLORREF RGB(cRed, cGreen, cBlue)    

This macro selects an RGB color based on the parameters supplied and the color capabilities of the output device.

Parameters

cRed

Specifies the intensity of the red color field.

cGreen

Specifies the intensity of the green color field.

cBlue

Specifies the intensity of the blue color field.

Return Value

The return value specifies the resultant RGB color.

Comments

The intensity for each argument can range from 0 to 255. If all three intensities are specified as 0, the result is black. If all three intensities are specified as 255, the result is white.

For information on using color values in a color palette, see the descriptions of the PALETTEINDEX and PALETTERGB macros, earlier in this chapter.

Comments

The RGB macro is defined as:

#define RGB(r, g ,b) ((DWORD)(((BYTE)(r) |

((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16)))

See Also

PALETTEINDEX, PALETTERGB