IVsHiColorItem::GetColorData Method (Int32, UInt32)
Visual Studio 2015
Retrieves the RGB value for the specified element.
Assembly: Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)
Parameters
- cdElement
-
Type:
System::Int32
[in] A value from the __tagVSCOLORDATA enumeration identifying the element for which to get the color.
- pcrColor
-
Type:
System::UInt32
[out] The requested RGB value.
From textmgr2.idl
interface IVsHiColorItem : IUnknown { HRESULT GetColorData([in] VSCOLORDATA cdElement, [out] COLORREF* pcrColor); };
Note that the returned RGB value is a Win32 COLORREF value.
In managed code, an RGB value can be converted to a COLORREF value with the code:
uint colorRef = (uint)System.Drawing.ColorTranslator.ToWin32( System.Drawing.Color.FromArgb(r, g, b));
In unmanaged code, use the RGB macro to create a COLORREF value, for example, RGB(0x00, 0xff,0x00).
Show: