windows_programming_notes.nbk: Home | Index | Next Page: Safe Subclassing in Win32 | Previous Page: resources
The RGB macro selects a red, green, blue (RGB) color based on the arguments supplied and the color capabilities of the output device.
COLORREF RGB( BYTE byRed, // red component of color BYTE byGreen, // green component of color BYTE byBlue // blue component of color );
The return value is the resultant RGB color as a COLORREF value.
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.
windows_programming_notes.nbk: Home | Index | Next Page: Safe Subclassing in Win32 | Previous Page: resources
Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time