Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

RGB macro

The RGB macro selects a red, green, blue (RGB) color based on the arguments supplied and the color capabilities of the output device.

Syntax


COLORREF RGB(
  BYTE byRed,
  BYTE byGreen,
  BYTE byBlue
);

Parameters

byRed

The intensity of the red color.

byGreen

The intensity of the green color.

byBlue

The intensity of the blue color.

Return value

The return value is the resultant RGB color as a COLORREF value.

Remarks

The intensity for each argument is in the range 0 through 255. If all three intensities are zero, the result is black. If all three intensities are 255, the result is white.

To extract the individual values for the red, green, and blue components of a COLORREF color value, use the GetRValue, GetGValue, and GetBValue macros, respectively.

When creating or examining a logical palette, use the RGBQUAD structure to define color values and examine individual component values. For more information about using color values in a color palette, see the descriptions of the PALETTEINDEX and PALETTERGB macros.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

See also

Colors Overview
Color Macros
COLORREF
GetBValue
GetGValue
GetRValue
PALETTEINDEX
PALETTERGB
RGBQUAD

 

 

Community Additions

Show:
© 2014 Microsoft