IVsFontAndColorUtilities.GetRGBOfItem Method

Definition

Obtain the RGB (COLORREF) values of the foreground and background color of a Font and Color Category from an instance of AllColorableItemInfo.

public:
 int GetRGBOfItem(cli::array <Microsoft::VisualStudio::Shell::Interop::AllColorableItemInfo> ^ pInfo, Guid % rguidCategory, [Runtime::InteropServices::Out] System::UInt32 % pcrForeground, [Runtime::InteropServices::Out] System::UInt32 % pcrBackground);
public int GetRGBOfItem (Microsoft.VisualStudio.Shell.Interop.AllColorableItemInfo[] pInfo, ref Guid rguidCategory, out uint pcrForeground, out uint pcrBackground);
abstract member GetRGBOfItem : Microsoft.VisualStudio.Shell.Interop.AllColorableItemInfo[] * Guid * uint32 * uint32 -> int
Public Function GetRGBOfItem (pInfo As AllColorableItemInfo(), ByRef rguidCategory As Guid, ByRef pcrForeground As UInteger, ByRef pcrBackground As UInteger) As Integer

Parameters

pInfo
AllColorableItemInfo[]

[in] An instance of AllColorableItemInfo. containing the Font and Color information for a given Category.

rguidCategory
Guid

[in] The GUID identifying the Category whose color values are to be obtained.

pcrForeground
UInt32

[out] A COLORREF representation of foreground color value.

pcrBackground
UInt32

[out] A COLORREF representation of background color value.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

The COLORREF returned in pcrBackground and in pcrForeground has the hexadecimal format of: 0x00bbggrr

Managed code can obtain functionality equivalent to GetSysColor with SystemColors and convert between COLORREF and the System.Drawing.Color structure using M:System.Drawing.ColorTranslator.FromWin32 and M:System.Drawing.ColorTranslator.ToWin32.

Applies to