Share via


RGBToHtml

Converts a COLORREF value to the HTML text corresponding to that color value.

bool inline RGBToHtml(
   COLORREF color,
   LPTSTR pbOut,
   long nBuffer 
);

Parameters

  • color
    An RGB color value.

  • pbOut
    Caller-allocated buffer to receive the text for the HTML color value. The buffer must have space for at least 8 characters including space for the null terminator).

  • nBuffer
    The size in bytes of the buffer (including space for the null terminator).

Return Value

Returns TRUE on success, FALSE on failure.

Remarks

An HTML color value is a pound sign followed by a 6-digit hexadecimal value using 2 digits for each of the red, green, and blue components of the color (for example, #FFFFFF is white).

Requirements

Header: atlutil.h

See Also

Other Resources

ATL Concepts

ATL Reference

ATL Functions Alphabetical Reference