Export (0) Print
Expand All

RGBA (Compact 2013)

3/28/2014

This macro selects a color based on the specified color values, the alpha value, and the capabilities of the output device.


COLORREF RGBA(
  BYTE byRed,
  BYTE byGreen,
  BYTE byBlue,
  BYTE alpha
);

byRed

Specifies the intensity of the red color.

byGreen

Specifies the intensity of the green color.

byBlue

Specifies the intensity of the blue color.

alpha

Specifies the alpha component of the overall color.

The return value is a COLORREF that corresponds to the supplied color and alpha values.

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.

For information about using color values in a color palette, see the description of the PALETTERGB macro.

The RGBA macro is defined as follows:

#ifndef RGBA
#define RGBA(r,g,b,a)        ((COLORREF)( (((DWORD)(BYTE)(a))<<24) |     RGB(r,g,b) ))
#endif

Header

windows.h

Show:
© 2015 Microsoft