2 instantiations of COLORREF
System.Windows.Forms (2)
System\Windows\Forms\Controls\ListView\ListViewInsertionMark.cs (1)
71_color = new COLORREF((uint)PInvokeCore.SendMessage(_listView, PInvoke.LVM_GETINSERTMARKCOLOR));
System\Windows\Forms\Help\Help.cs (1)
84clrForeground = new COLORREF(unchecked((uint)-1)), // Ignore
117 references to COLORREF
System.Private.Windows.Core (13)
System\Private\Windows\Ole\DragDropHelper.cs (1)
278crColorKey = (COLORREF)PInvokeCore.GetSysColor(SYS_COLOR_INDEX.COLOR_WINDOW)
Windows\Win32\Foundation\COLORREF.cs (4)
12/// <see cref="COLORREF"/> is a DWORD- passing constants in native code would just pass the value as is. 22public static implicit operator COLORREF(Color color) => new((uint)ColorTranslator.ToWin32(color)); 23public static implicit operator Color(COLORREF color) => ColorTranslator.FromWin32((int)color.Value); 24public static implicit operator COLORREF(int color) => new((uint)color);
Windows\Win32\Graphics\Gdi\CreateBrushScope.cs (1)
27/// Creates a solid brush based on the <paramref name="color"/> using <see cref="PInvokeCore.CreateSolidBrush(COLORREF)"/>.
Windows\Win32\Graphics\Gdi\CreatePenScope.cs (1)
27/// <see cref="PInvokeCore.CreatePen(PEN_STYLE, int, COLORREF)" />.
Windows\Win32\Graphics\Gdi\SetBackgroundColorScope.cs (3)
18private readonly COLORREF _previousColor; 23/// <see cref="PInvokeCore.SetBkColor(HDC, COLORREF)"/>. 25public SetBackgroundColorScope(HDC hdc, COLORREF color)
Windows\Win32\Graphics\Gdi\SetTextColorScope.cs (3)
22private readonly COLORREF _previousColor; 27/// <see cref="PInvokeCore.SetTextColor(HDC, COLORREF)"/>. 29public SetTextColorScope(HDC hdc, COLORREF color)
System.Windows.Forms (53)
System\Windows\Forms\Control.cs (3)
778backBrush = PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(color)); 5857PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 5858PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(BackColor));
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
2004PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 2005PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(BackColor));
System\Windows\Forms\Controls\ImageList\ImageList.cs (5)
434PInvoke.ImageList.SetBkColor(this, (COLORREF)PInvokeCore.CLR_NONE); 539(COLORREF)PInvokeCore.CLR_NONE, 540(COLORREF)PInvokeCore.CLR_NONE, 675(COLORREF)PInvokeCore.CLR_NONE, 676(COLORREF)PInvokeCore.CLR_NONE,
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
1361(int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(foreBrush.Color)).Value);
System\Windows\Forms\Controls\ListView\ListView.cs (5)
2855? (COLORREF)ColorTranslator.ToWin32(_odCacheForeColor) 2856: (COLORREF)ColorTranslator.ToWin32(riFore); 2882nmcd->clrText = (COLORREF)((int)(nmcd->clrText & (~mask)) | color); 2898? (COLORREF)ColorTranslator.ToWin32(_odCacheBackColor) 2899: (COLORREF)ColorTranslator.ToWin32(riBack);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
1797if (!PInvoke.SetLayeredWindowAttributes(this, (COLORREF)0, OpacityAsByte, LAYERED_WINDOW_ATTRIBUTES_FLAGS.LWA_ALPHA))
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (11)
92COLORREF backColor, 93COLORREF textColor) 157COLORREF savedColor; 160savedColor = PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 171PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlDark)); 232(COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Control), 233(COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 266COLORREF oldTextColor = PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 267COLORREF oldBackColor = PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Control));
System\Windows\Forms\Dialogs\CommonDialogs\ColorDialog.cs (9)
19private readonly COLORREF[] _customColors = new COLORREF[16]; 77MemoryMarshal.Cast<COLORREF, int>(_customColors).CopyTo(result); 82Span<COLORREF> customColors = _customColors; 87MemoryMarshal.Cast<int, COLORREF>(value)[..Math.Min(customColors.Length, value.Length)].CopyTo(customColors); 168Span<COLORREF> customColors = stackalloc COLORREF[16]; 176rgbResult = (COLORREF)_color, 181fixed (COLORREF* c = customColors)
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
318UpdateColor((COLORREF)(int)PInvoke.SendDlgItemMessage(
System\Windows\Forms\Form.cs (7)
2521COLORREF colorRef; 2527(uint)sizeof(COLORREF)); 2534COLORREF colorRef = color; 2540(uint)sizeof(COLORREF)); 6139result = PInvoke.SetLayeredWindowAttributes(this, (COLORREF)0, OpacityAsByte, LAYERED_WINDOW_ATTRIBUTES_FLAGS.LWA_ALPHA); 6144result = PInvoke.SetLayeredWindowAttributes(this, (COLORREF)transparencyKey, 0, LAYERED_WINDOW_ATTRIBUTES_FLAGS.LWA_COLORKEY); 6148result = PInvoke.SetLayeredWindowAttributes(this, (COLORREF)transparencyKey, OpacityAsByte, LAYERED_WINDOW_ATTRIBUTES_FLAGS.LWA_ALPHA | LAYERED_WINDOW_ATTRIBUTES_FLAGS.LWA_COLORKEY);
System\Windows\Forms\Rendering\ControlPaint.cs (7)
318PInvokeCore.SetBkColor(targetDC, (COLORREF)0x00ffffff); // white 319PInvokeCore.SetTextColor(targetDC, (COLORREF)0x00000000); // black 1804FrameStyle.Dashed => (HGDIOBJ)PInvokeCore.CreatePen(PEN_STYLE.PS_DOT, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1805FrameStyle.Thick => (HGDIOBJ)PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 2, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1813PInvokeCore.SetBkColor(desktopDC, (COLORREF)(uint)ColorTranslator.ToWin32(graphicsColor)); 1829using ObjectScope pen = new(PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor))); 2044using ObjectScope brush = new(PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(backColor)));
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (1)
493_lastHResult = PInvoke.GetThemeColor(HTHEME, Part, State, (THEME_PROPERTY_SYMBOL_ID)prop, out COLORREF color);
System.Windows.Forms.Design (9)
System\Windows\Forms\Design\DesignerUtils.cs (8)
28PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 30PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 32PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 34PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 173s_grabHandleFillBrushPrimary = PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 176s_grabHandleFillBrush = PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 179s_grabHandlePenPrimary = PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 182s_grabHandlePen = PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window));
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
444PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(graphicsColor));
System.Windows.Forms.Primitives (15)
System\Windows\Forms\DeviceContextExtensions.cs (2)
101/// Calls <see cref="PInvoke.GetNearestColor(HDC, COLORREF)"/> to get the nearest color for the given 119Color newColor = ColorTranslator.FromWin32((int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(color)).Value);
Windows\Win32\PInvoke.ImageList.cs (8)
37/// <inheritdoc cref="ImageList_DrawEx(HIMAGELIST, int, HDC, int, int, int, int, COLORREF, COLORREF, IMAGE_LIST_DRAW_STYLE)"/> 46COLORREF rgbBk, 47COLORREF rgbFg, 112/// <inheritdoc cref="ImageList_SetBkColor(HIMAGELIST, COLORREF)"/> 113public static COLORREF SetBkColor<T>(T himl, COLORREF clrBk) where T : IHandle<HIMAGELIST> 115COLORREF result = ImageList_SetBkColor(himl.Handle, clrBk);
Windows\Win32\PInvoke.SetLayeredWindowAttributes.cs (2)
8/// <inheritdoc cref="SetLayeredWindowAttributes(HWND, COLORREF, byte, LAYERED_WINDOW_ATTRIBUTES_FLAGS)"/> 9public static BOOL SetLayeredWindowAttributes<T>(T hwnd, COLORREF crKey, byte bAlpha, LAYERED_WINDOW_ATTRIBUTES_FLAGS dwFlags)
Windows\Win32\UI\Controls\Dialogs\CHOOSECOLORW.cs (2)
80public COLORREF rgbResult; 99public unsafe COLORREF* lpCustColors;
Windows\Win32\UI\Controls\Dialogs\CHOOSEFONTW.cs (1)
109public COLORREF rgbColors;
System.Windows.Forms.Primitives.Tests (6)
System\Windows\Forms\Automation\TestAccessors.UiaTextRangeTestAccessor.cs (2)
49public COLORREF GetBackgroundColor() => s_static.GetBackgroundColor(); 57public COLORREF GetForegroundColor() => s_static.GetForegroundColor();
System\Windows\Forms\Automation\UiaTextRangeTests.cs (4)
479yield return new object[] { UIA_TEXTATTRIBUTE_ID.UIA_BackgroundColorAttributeId, (int)(uint)(COLORREF)PInvokeCore.GetSysColor(SYS_COLOR_INDEX.COLOR_WINDOW) }; 484yield return new object[] { UIA_TEXTATTRIBUTE_ID.UIA_ForegroundColorAttributeId, (int)(uint)default(COLORREF) }; 1166COLORREF actual = StaticNullTextRange.TestAccessor().GetBackgroundColor(); 1231COLORREF actual = StaticNullTextRange.TestAccessor().GetForegroundColor();
System.Windows.Forms.Primitives.TestUtilities (21)
DeviceContextState.cs (4)
58public COLORREF BackColor { get => _currentState.BackColor; set => _currentState.BackColor = value; } 59public COLORREF TextColor { get => _currentState.TextColor; set => _currentState.TextColor = value; } 75public COLORREF BackColor { get; set; } 76public COLORREF TextColor { get; set; }
Extensions\GdiExtensions.cs (1)
11public static string ToSystemColorString(this COLORREF colorRef)
Metafiles\RecordTypes\EMRBITBLT.cs (1)
25public COLORREF crBkColorSrc; // Source DC BkColor in RGB
Metafiles\RecordTypes\EMRCREATEBRUSHINDIRECT.cs (1)
25public COLORREF lbColor;
Metafiles\RecordTypes\EMREXTCREATEPEN.cs (1)
33public COLORREF elpColor;
Metafiles\RecordTypes\EMRSETCOLOR.cs (1)
23public COLORREF crColor;
Metafiles\Validators\BrushColorValidator.cs (1)
14public void Validate(DeviceContextState state) => Assert.Equal((COLORREF)_brushColor, state.SelectedBrush.lbColor);
Metafiles\Validators\BrushValidator.cs (1)
23Assert.Equal((COLORREF)_brushColor, state.SelectedBrush.lbColor);
Metafiles\Validators\PenColorValidator.cs (1)
14public void Validate(DeviceContextState state) => Assert.Equal((COLORREF)_penColor, state.SelectedPen.elpColor);
Metafiles\Validators\PenValidator.cs (1)
26Assert.Equal((COLORREF)_penColor, state.SelectedPen.elpColor);
Metafiles\Validators\TextColorValidator.cs (1)
14public void Validate(DeviceContextState state) => Assert.Equal((COLORREF)_textColor, state.TextColor);
SystemCOLORs.cs (7)
8private static readonly Dictionary<COLORREF, List<SYS_COLOR_INDEX>> s_systemColors = CreateColorDictionary(); 44public static bool TryGetSystemColor(COLORREF colorRef, out List<SYS_COLOR_INDEX> colors) 47public static string ToSystemColorString(COLORREF colorRef) 60private static Dictionary<COLORREF, List<SYS_COLOR_INDEX>> CreateColorDictionary() 62Dictionary<COLORREF, List<SYS_COLOR_INDEX>> dictionary = []; 72COLORREF colorRef = (COLORREF)PInvokeCore.GetSysColor((SYS_COLOR_INDEX)i);