77 references to ColorTranslator
System.Drawing (1)
System.Drawing.cs (1)
15[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.ColorTranslator))]
System.Drawing.Common (1)
Special\Forwards.cs (1)
17[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.ColorTranslator))]
System.Drawing.Common.Tests (8)
System\Drawing\ColorTranslatorTests.cs (8)
56Assert.Equal(expected, ColorTranslator.ToWin32(color)); 80Assert.Equal(color, ColorTranslator.FromOle(oleColor)); 81Assert.Equal(color, ColorTranslator.FromWin32(oleColor)); 106Assert.Equal(oleColor, ColorTranslator.ToOle(color)); 189Assert.Equal(expected, ColorTranslator.FromHtml(htmlColor)); 210Exception exception = AssertExtensions.Throws<ArgumentException, Exception>(() => ColorTranslator.FromHtml(htmlColor)); 231Assert.Throws(exception, () => ColorTranslator.FromHtml(htmlColor)); 258Assert.Equal(expected, ColorTranslator.ToHtml(color));
System.Private.Windows.Core (7)
Windows\Win32\Foundation\COLORREF.cs (3)
11/// any conversion in <see cref="Color"/>, <see cref="ColorTranslator"/>, etc. as they can change the value. 22public static implicit operator COLORREF(Color color) => new((uint)ColorTranslator.ToWin32(color)); 23public static implicit operator Color(COLORREF color) => ColorTranslator.FromWin32((int)color.Value);
Windows\Win32\Foundation\LPARAM.cs (1)
26public static explicit operator LPARAM(Color value) => (LPARAM)ColorTranslator.ToWin32(value);
Windows\Win32\Foundation\WPARAM.cs (1)
31public static explicit operator WPARAM(Color value) => new((nuint)ColorTranslator.ToWin32(value));
Windows\Win32\Graphics\GdiPlus\GpBitmapExtensions.cs (1)
43(uint)ColorTranslator.ToWin32(background)).ThrowIfFailed();
Windows\Win32\PInvoke.GetSysColorBrush.cs (1)
30return GetSysColorBrush((SYS_COLOR_INDEX)(ColorTranslator.ToOle(systemColor) & 0xFF));
System.Windows.Forms (42)
System\Windows\Forms\ActiveX\AxHost.cs (2)
3666return ColorTranslator.FromOle((int)color); 3676return (uint)ColorTranslator.ToOle(color);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (4)
186property.Value = ColorTranslator.FromOle(value.data.intVal); 247property.Value = ColorTranslator.FromOle(value.data.intVal); 1372prop.Value = ColorTranslator.FromOle((int)pQaContainer->colorBack); 1375prop.Value = ColorTranslator.FromOle((int)pQaContainer->colorFore);
System\Windows\Forms\ComponentModel\COM2Interop\COM2ColorConverter.cs (2)
17=> ColorTranslator.FromOle(nativeValue.Type switch 34return (VARIANT)ColorTranslator.ToOle(managedValueAsColor);
System\Windows\Forms\Control.cs (3)
704backBrush = PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(color)); 5748PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 5749PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(BackColor));
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
2002PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 2003PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(BackColor));
System\Windows\Forms\Controls\Labels\LinkLabel.cs (2)
1360color = ColorTranslator.FromWin32( 1361(int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(foreBrush.Color)).Value);
System\Windows\Forms\Controls\ListView\ListView.cs (5)
2839? (COLORREF)ColorTranslator.ToWin32(_odCacheForeColor) 2840: (COLORREF)ColorTranslator.ToWin32(riFore); 2850if (nmcd->clrText == ColorTranslator.ToWin32(SystemColors.HotTrack)) 2882? (COLORREF)ColorTranslator.ToWin32(_odCacheBackColor) 2883: (COLORREF)ColorTranslator.ToWin32(riBack);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (6)
851selColor = ColorTranslator.FromOle(cf.crTextColor); 862cf.crTextColor = ColorTranslator.ToWin32(value); 892selColor = ColorTranslator.FromOle(cf2.crBackColor); 921cf2.crBackColor = ColorTranslator.ToWin32(value); 2117&& ColorTranslator.ToWin32(value) == cf.crTextColor) 2124cf.crTextColor = ColorTranslator.ToWin32(value);
System\Windows\Forms\Controls\TreeView\TreeView.cs (3)
861return ColorTranslator.FromWin32(intColor); 2787nmtvcd->clrText = ColorTranslator.ToWin32(riFore); 2792nmtvcd->clrTextBk = ColorTranslator.ToWin32(riBack);
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (6)
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\FontDialog.cs (2)
101return !_usingDefaultIndirectColor ? _color : ColorTranslator.FromWin32(ColorTranslator.ToWin32(_color));
System\Windows\Forms\Rendering\ControlPaint.cs (5)
1808FrameStyle.Dashed => (HGDIOBJ)PInvokeCore.CreatePen(PEN_STYLE.PS_DOT, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1809FrameStyle.Thick => (HGDIOBJ)PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 2, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1817PInvokeCore.SetBkColor(desktopDC, (COLORREF)(uint)ColorTranslator.ToWin32(graphicsColor)); 1833using ObjectScope pen = new(PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor))); 2048using ObjectScope brush = new(PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(backColor)));
System.Windows.Forms.Design (10)
System\Drawing\Design\ColorEditor.ColorPalette.cs (1)
80_staticColors[i] = ColorTranslator.FromOle(s_staticCells[i]);
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 (3)
System\Drawing\ColorExtensions.cs (1)
8public static int ToWin32(this Color color) => ColorTranslator.ToWin32(color);
System\Windows\Forms\DeviceContextExtensions.cs (2)
119Color newColor = ColorTranslator.FromWin32((int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(color)).Value);
System.Windows.Forms.Tests (5)
System\Windows\Forms\DateTimePickerTests.cs (5)
189Action act = () => control.CalendarTitleBackColor = ColorTranslator.FromHtml(value); 211Action act = () => control.CalendarForeColor = ColorTranslator.FromHtml(value); 233Action act = () => control.CalendarTitleForeColor = ColorTranslator.FromHtml(value); 255Action act = () => control.CalendarTrailingForeColor = ColorTranslator.FromHtml(value); 277Action act = () => control.CalendarMonthBackground = ColorTranslator.FromHtml(value);