376 references to KnownColor
BinaryFormatTests (1)
FormatTests\FormattedObject\BinaryFormatWriterTests.cs (1)
202
Color.FromKnownColor(
KnownColor
.ActiveCaption),
netstandard (1)
netstandard.cs (1)
747
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
KnownColor
))]
System.Drawing (1)
System.Drawing.cs (1)
102
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
KnownColor
))]
System.Drawing.Common (1)
Special\Forwards.cs (1)
7
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
KnownColor
))]
System.Drawing.Primitives (322)
System\Drawing\Color.cs (155)
24
public static Color Transparent => new Color(
KnownColor
.Transparent);
26
public static Color AliceBlue => new Color(
KnownColor
.AliceBlue);
28
public static Color AntiqueWhite => new Color(
KnownColor
.AntiqueWhite);
30
public static Color Aqua => new Color(
KnownColor
.Aqua);
32
public static Color Aquamarine => new Color(
KnownColor
.Aquamarine);
34
public static Color Azure => new Color(
KnownColor
.Azure);
36
public static Color Beige => new Color(
KnownColor
.Beige);
38
public static Color Bisque => new Color(
KnownColor
.Bisque);
40
public static Color Black => new Color(
KnownColor
.Black);
42
public static Color BlanchedAlmond => new Color(
KnownColor
.BlanchedAlmond);
44
public static Color Blue => new Color(
KnownColor
.Blue);
46
public static Color BlueViolet => new Color(
KnownColor
.BlueViolet);
48
public static Color Brown => new Color(
KnownColor
.Brown);
50
public static Color BurlyWood => new Color(
KnownColor
.BurlyWood);
52
public static Color CadetBlue => new Color(
KnownColor
.CadetBlue);
54
public static Color Chartreuse => new Color(
KnownColor
.Chartreuse);
56
public static Color Chocolate => new Color(
KnownColor
.Chocolate);
58
public static Color Coral => new Color(
KnownColor
.Coral);
60
public static Color CornflowerBlue => new Color(
KnownColor
.CornflowerBlue);
62
public static Color Cornsilk => new Color(
KnownColor
.Cornsilk);
64
public static Color Crimson => new Color(
KnownColor
.Crimson);
66
public static Color Cyan => new Color(
KnownColor
.Cyan);
68
public static Color DarkBlue => new Color(
KnownColor
.DarkBlue);
70
public static Color DarkCyan => new Color(
KnownColor
.DarkCyan);
72
public static Color DarkGoldenrod => new Color(
KnownColor
.DarkGoldenrod);
74
public static Color DarkGray => new Color(
KnownColor
.DarkGray);
76
public static Color DarkGreen => new Color(
KnownColor
.DarkGreen);
78
public static Color DarkKhaki => new Color(
KnownColor
.DarkKhaki);
80
public static Color DarkMagenta => new Color(
KnownColor
.DarkMagenta);
82
public static Color DarkOliveGreen => new Color(
KnownColor
.DarkOliveGreen);
84
public static Color DarkOrange => new Color(
KnownColor
.DarkOrange);
86
public static Color DarkOrchid => new Color(
KnownColor
.DarkOrchid);
88
public static Color DarkRed => new Color(
KnownColor
.DarkRed);
90
public static Color DarkSalmon => new Color(
KnownColor
.DarkSalmon);
92
public static Color DarkSeaGreen => new Color(
KnownColor
.DarkSeaGreen);
94
public static Color DarkSlateBlue => new Color(
KnownColor
.DarkSlateBlue);
96
public static Color DarkSlateGray => new Color(
KnownColor
.DarkSlateGray);
98
public static Color DarkTurquoise => new Color(
KnownColor
.DarkTurquoise);
100
public static Color DarkViolet => new Color(
KnownColor
.DarkViolet);
102
public static Color DeepPink => new Color(
KnownColor
.DeepPink);
104
public static Color DeepSkyBlue => new Color(
KnownColor
.DeepSkyBlue);
106
public static Color DimGray => new Color(
KnownColor
.DimGray);
108
public static Color DodgerBlue => new Color(
KnownColor
.DodgerBlue);
110
public static Color Firebrick => new Color(
KnownColor
.Firebrick);
112
public static Color FloralWhite => new Color(
KnownColor
.FloralWhite);
114
public static Color ForestGreen => new Color(
KnownColor
.ForestGreen);
116
public static Color Fuchsia => new Color(
KnownColor
.Fuchsia);
118
public static Color Gainsboro => new Color(
KnownColor
.Gainsboro);
120
public static Color GhostWhite => new Color(
KnownColor
.GhostWhite);
122
public static Color Gold => new Color(
KnownColor
.Gold);
124
public static Color Goldenrod => new Color(
KnownColor
.Goldenrod);
126
public static Color Gray => new Color(
KnownColor
.Gray);
128
public static Color Green => new Color(
KnownColor
.Green);
130
public static Color GreenYellow => new Color(
KnownColor
.GreenYellow);
132
public static Color Honeydew => new Color(
KnownColor
.Honeydew);
134
public static Color HotPink => new Color(
KnownColor
.HotPink);
136
public static Color IndianRed => new Color(
KnownColor
.IndianRed);
138
public static Color Indigo => new Color(
KnownColor
.Indigo);
140
public static Color Ivory => new Color(
KnownColor
.Ivory);
142
public static Color Khaki => new Color(
KnownColor
.Khaki);
144
public static Color Lavender => new Color(
KnownColor
.Lavender);
146
public static Color LavenderBlush => new Color(
KnownColor
.LavenderBlush);
148
public static Color LawnGreen => new Color(
KnownColor
.LawnGreen);
150
public static Color LemonChiffon => new Color(
KnownColor
.LemonChiffon);
152
public static Color LightBlue => new Color(
KnownColor
.LightBlue);
154
public static Color LightCoral => new Color(
KnownColor
.LightCoral);
156
public static Color LightCyan => new Color(
KnownColor
.LightCyan);
158
public static Color LightGoldenrodYellow => new Color(
KnownColor
.LightGoldenrodYellow);
160
public static Color LightGreen => new Color(
KnownColor
.LightGreen);
162
public static Color LightGray => new Color(
KnownColor
.LightGray);
164
public static Color LightPink => new Color(
KnownColor
.LightPink);
166
public static Color LightSalmon => new Color(
KnownColor
.LightSalmon);
168
public static Color LightSeaGreen => new Color(
KnownColor
.LightSeaGreen);
170
public static Color LightSkyBlue => new Color(
KnownColor
.LightSkyBlue);
172
public static Color LightSlateGray => new Color(
KnownColor
.LightSlateGray);
174
public static Color LightSteelBlue => new Color(
KnownColor
.LightSteelBlue);
176
public static Color LightYellow => new Color(
KnownColor
.LightYellow);
178
public static Color Lime => new Color(
KnownColor
.Lime);
180
public static Color LimeGreen => new Color(
KnownColor
.LimeGreen);
182
public static Color Linen => new Color(
KnownColor
.Linen);
184
public static Color Magenta => new Color(
KnownColor
.Magenta);
186
public static Color Maroon => new Color(
KnownColor
.Maroon);
188
public static Color MediumAquamarine => new Color(
KnownColor
.MediumAquamarine);
190
public static Color MediumBlue => new Color(
KnownColor
.MediumBlue);
192
public static Color MediumOrchid => new Color(
KnownColor
.MediumOrchid);
194
public static Color MediumPurple => new Color(
KnownColor
.MediumPurple);
196
public static Color MediumSeaGreen => new Color(
KnownColor
.MediumSeaGreen);
198
public static Color MediumSlateBlue => new Color(
KnownColor
.MediumSlateBlue);
200
public static Color MediumSpringGreen => new Color(
KnownColor
.MediumSpringGreen);
202
public static Color MediumTurquoise => new Color(
KnownColor
.MediumTurquoise);
204
public static Color MediumVioletRed => new Color(
KnownColor
.MediumVioletRed);
206
public static Color MidnightBlue => new Color(
KnownColor
.MidnightBlue);
208
public static Color MintCream => new Color(
KnownColor
.MintCream);
210
public static Color MistyRose => new Color(
KnownColor
.MistyRose);
212
public static Color Moccasin => new Color(
KnownColor
.Moccasin);
214
public static Color NavajoWhite => new Color(
KnownColor
.NavajoWhite);
216
public static Color Navy => new Color(
KnownColor
.Navy);
218
public static Color OldLace => new Color(
KnownColor
.OldLace);
220
public static Color Olive => new Color(
KnownColor
.Olive);
222
public static Color OliveDrab => new Color(
KnownColor
.OliveDrab);
224
public static Color Orange => new Color(
KnownColor
.Orange);
226
public static Color OrangeRed => new Color(
KnownColor
.OrangeRed);
228
public static Color Orchid => new Color(
KnownColor
.Orchid);
230
public static Color PaleGoldenrod => new Color(
KnownColor
.PaleGoldenrod);
232
public static Color PaleGreen => new Color(
KnownColor
.PaleGreen);
234
public static Color PaleTurquoise => new Color(
KnownColor
.PaleTurquoise);
236
public static Color PaleVioletRed => new Color(
KnownColor
.PaleVioletRed);
238
public static Color PapayaWhip => new Color(
KnownColor
.PapayaWhip);
240
public static Color PeachPuff => new Color(
KnownColor
.PeachPuff);
242
public static Color Peru => new Color(
KnownColor
.Peru);
244
public static Color Pink => new Color(
KnownColor
.Pink);
246
public static Color Plum => new Color(
KnownColor
.Plum);
248
public static Color PowderBlue => new Color(
KnownColor
.PowderBlue);
250
public static Color Purple => new Color(
KnownColor
.Purple);
256
public static Color RebeccaPurple => new Color(
KnownColor
.RebeccaPurple);
258
public static Color Red => new Color(
KnownColor
.Red);
260
public static Color RosyBrown => new Color(
KnownColor
.RosyBrown);
262
public static Color RoyalBlue => new Color(
KnownColor
.RoyalBlue);
264
public static Color SaddleBrown => new Color(
KnownColor
.SaddleBrown);
266
public static Color Salmon => new Color(
KnownColor
.Salmon);
268
public static Color SandyBrown => new Color(
KnownColor
.SandyBrown);
270
public static Color SeaGreen => new Color(
KnownColor
.SeaGreen);
272
public static Color SeaShell => new Color(
KnownColor
.SeaShell);
274
public static Color Sienna => new Color(
KnownColor
.Sienna);
276
public static Color Silver => new Color(
KnownColor
.Silver);
278
public static Color SkyBlue => new Color(
KnownColor
.SkyBlue);
280
public static Color SlateBlue => new Color(
KnownColor
.SlateBlue);
282
public static Color SlateGray => new Color(
KnownColor
.SlateGray);
284
public static Color Snow => new Color(
KnownColor
.Snow);
286
public static Color SpringGreen => new Color(
KnownColor
.SpringGreen);
288
public static Color SteelBlue => new Color(
KnownColor
.SteelBlue);
290
public static Color Tan => new Color(
KnownColor
.Tan);
292
public static Color Teal => new Color(
KnownColor
.Teal);
294
public static Color Thistle => new Color(
KnownColor
.Thistle);
296
public static Color Tomato => new Color(
KnownColor
.Tomato);
298
public static Color Turquoise => new Color(
KnownColor
.Turquoise);
300
public static Color Violet => new Color(
KnownColor
.Violet);
302
public static Color Wheat => new Color(
KnownColor
.Wheat);
304
public static Color White => new Color(
KnownColor
.White);
306
public static Color WhiteSmoke => new Color(
KnownColor
.WhiteSmoke);
308
public static Color Yellow => new Color(
KnownColor
.Yellow);
310
public static Color YellowGreen => new Color(
KnownColor
.YellowGreen);
348
internal Color(
KnownColor
knownColor)
356
private Color(long value, short state, string? name,
KnownColor
knownColor)
378
public bool IsSystemColor => IsKnownColor && IsKnownColorSystem((
KnownColor
)knownColor);
380
internal static bool IsKnownColorSystem(
KnownColor
knownColor)
401
string tablename = KnownColorNames.KnownColorToName((
KnownColor
)knownColor);
402
Debug.Assert(tablename != null, $"Could not find known color '{(
KnownColor
)knownColor}' in the KnownColorTable");
425
return KnownColorTable.KnownColorToArgb((
KnownColor
)knownColor);
441
private static Color FromArgb(uint argb) => new Color(argb, StateARGBValueValid, null, (
KnownColor
)0);
472
public static Color FromKnownColor(
KnownColor
color) =>
473
color <= 0 || color >
KnownColor
.RebeccaPurple ? FromName(color.ToString()) : new Color(color);
482
return new Color(NotDefinedValue, StateNameValid, name, (
KnownColor
)0);
570
public
KnownColor
ToKnownColor() => (
KnownColor
)knownColor;
System\Drawing\ColorTranslator.cs (120)
60
case
KnownColor
.ActiveBorder:
62
case
KnownColor
.ActiveCaption:
64
case
KnownColor
.ActiveCaptionText:
66
case
KnownColor
.AppWorkspace:
68
case
KnownColor
.ButtonFace:
70
case
KnownColor
.ButtonHighlight:
72
case
KnownColor
.ButtonShadow:
74
case
KnownColor
.Control:
76
case
KnownColor
.ControlDark:
78
case
KnownColor
.ControlDarkDark:
80
case
KnownColor
.ControlLight:
82
case
KnownColor
.ControlLightLight:
84
case
KnownColor
.ControlText:
86
case
KnownColor
.Desktop:
88
case
KnownColor
.GradientActiveCaption:
90
case
KnownColor
.GradientInactiveCaption:
92
case
KnownColor
.GrayText:
94
case
KnownColor
.Highlight:
96
case
KnownColor
.HighlightText:
98
case
KnownColor
.HotTrack:
100
case
KnownColor
.InactiveBorder:
102
case
KnownColor
.InactiveCaption:
104
case
KnownColor
.InactiveCaptionText:
106
case
KnownColor
.Info:
108
case
KnownColor
.InfoText:
110
case
KnownColor
.Menu:
112
case
KnownColor
.MenuBar:
114
case
KnownColor
.MenuHighlight:
116
case
KnownColor
.MenuText:
118
case
KnownColor
.ScrollBar:
120
case
KnownColor
.Window:
122
case
KnownColor
.WindowFrame:
124
case
KnownColor
.WindowText:
145
return Color.FromKnownColor(
KnownColor
.ActiveBorder);
147
return Color.FromKnownColor(
KnownColor
.ActiveCaption);
149
return Color.FromKnownColor(
KnownColor
.ActiveCaptionText);
151
return Color.FromKnownColor(
KnownColor
.AppWorkspace);
153
return Color.FromKnownColor(
KnownColor
.Control);
155
return Color.FromKnownColor(
KnownColor
.ControlDark);
157
return Color.FromKnownColor(
KnownColor
.ControlDarkDark);
159
return Color.FromKnownColor(
KnownColor
.ControlLight);
161
return Color.FromKnownColor(
KnownColor
.ControlLightLight);
163
return Color.FromKnownColor(
KnownColor
.ControlText);
165
return Color.FromKnownColor(
KnownColor
.Desktop);
167
return Color.FromKnownColor(
KnownColor
.GradientActiveCaption);
169
return Color.FromKnownColor(
KnownColor
.GradientInactiveCaption);
171
return Color.FromKnownColor(
KnownColor
.GrayText);
173
return Color.FromKnownColor(
KnownColor
.Highlight);
175
return Color.FromKnownColor(
KnownColor
.HighlightText);
177
return Color.FromKnownColor(
KnownColor
.HotTrack);
179
return Color.FromKnownColor(
KnownColor
.InactiveBorder);
181
return Color.FromKnownColor(
KnownColor
.InactiveCaption);
183
return Color.FromKnownColor(
KnownColor
.InactiveCaptionText);
185
return Color.FromKnownColor(
KnownColor
.Info);
187
return Color.FromKnownColor(
KnownColor
.InfoText);
189
return Color.FromKnownColor(
KnownColor
.Menu);
191
return Color.FromKnownColor(
KnownColor
.MenuBar);
193
return Color.FromKnownColor(
KnownColor
.MenuHighlight);
195
return Color.FromKnownColor(
KnownColor
.MenuText);
197
return Color.FromKnownColor(
KnownColor
.ScrollBar);
199
return Color.FromKnownColor(
KnownColor
.Window);
201
return Color.FromKnownColor(
KnownColor
.WindowFrame);
203
return Color.FromKnownColor(
KnownColor
.WindowText);
299
case
KnownColor
.ActiveBorder:
302
case
KnownColor
.GradientActiveCaption:
303
case
KnownColor
.ActiveCaption:
306
case
KnownColor
.AppWorkspace:
309
case
KnownColor
.Desktop:
312
case
KnownColor
.Control:
313
case
KnownColor
.ControlLight:
316
case
KnownColor
.ControlDark:
319
case
KnownColor
.ControlText:
322
case
KnownColor
.ActiveCaptionText:
325
case
KnownColor
.GrayText:
328
case
KnownColor
.HotTrack:
329
case
KnownColor
.Highlight:
332
case
KnownColor
.MenuHighlight:
333
case
KnownColor
.HighlightText:
336
case
KnownColor
.InactiveBorder:
339
case
KnownColor
.GradientInactiveCaption:
340
case
KnownColor
.InactiveCaption:
343
case
KnownColor
.InactiveCaptionText:
346
case
KnownColor
.Info:
349
case
KnownColor
.InfoText:
352
case
KnownColor
.MenuBar:
353
case
KnownColor
.Menu:
356
case
KnownColor
.MenuText:
359
case
KnownColor
.ScrollBar:
362
case
KnownColor
.ControlDarkDark:
365
case
KnownColor
.ControlLightLight:
368
case
KnownColor
.Window:
371
case
KnownColor
.WindowFrame:
374
case
KnownColor
.WindowText:
404
["activeborder"] = Color.FromKnownColor(
KnownColor
.ActiveBorder),
405
["activecaption"] = Color.FromKnownColor(
KnownColor
.ActiveCaption),
406
["appworkspace"] = Color.FromKnownColor(
KnownColor
.AppWorkspace),
407
["background"] = Color.FromKnownColor(
KnownColor
.Desktop),
408
["buttonface"] = Color.FromKnownColor(
KnownColor
.Control),
409
["buttonhighlight"] = Color.FromKnownColor(
KnownColor
.ControlLightLight),
410
["buttonshadow"] = Color.FromKnownColor(
KnownColor
.ControlDark),
411
["buttontext"] = Color.FromKnownColor(
KnownColor
.ControlText),
412
["captiontext"] = Color.FromKnownColor(
KnownColor
.ActiveCaptionText),
413
["graytext"] = Color.FromKnownColor(
KnownColor
.GrayText),
414
["highlight"] = Color.FromKnownColor(
KnownColor
.Highlight),
415
["highlighttext"] = Color.FromKnownColor(
KnownColor
.HighlightText),
416
["inactiveborder"] = Color.FromKnownColor(
KnownColor
.InactiveBorder),
417
["inactivecaption"] = Color.FromKnownColor(
KnownColor
.InactiveCaption),
418
["inactivecaptiontext"] = Color.FromKnownColor(
KnownColor
.InactiveCaptionText),
419
["infobackground"] = Color.FromKnownColor(
KnownColor
.Info),
420
["infotext"] = Color.FromKnownColor(
KnownColor
.InfoText),
421
["menu"] = Color.FromKnownColor(
KnownColor
.Menu),
422
["menutext"] = Color.FromKnownColor(
KnownColor
.MenuText),
423
["scrollbar"] = Color.FromKnownColor(
KnownColor
.ScrollBar),
424
["threeddarkshadow"] = Color.FromKnownColor(
KnownColor
.ControlDarkDark),
425
["threedface"] = Color.FromKnownColor(
KnownColor
.Control),
426
["threedhighlight"] = Color.FromKnownColor(
KnownColor
.ControlLight),
427
["threedlightshadow"] = Color.FromKnownColor(
KnownColor
.ControlLightLight),
428
["window"] = Color.FromKnownColor(
KnownColor
.Window),
429
["windowframe"] = Color.FromKnownColor(
KnownColor
.WindowFrame),
430
["windowtext"] = Color.FromKnownColor(
KnownColor
.WindowText)
System\Drawing\KnownColorNames.cs (2)
197
public static string KnownColorToName(
KnownColor
color)
199
Debug.Assert(color > 0 && color <=
KnownColor
.RebeccaPurple);
System\Drawing\KnownColorTable.cs (8)
485
return Color.FromKnownColor((
KnownColor
)index);
493
public static uint KnownColorToArgb(
KnownColor
color)
495
Debug.Assert(color > 0 && color <=
KnownColor
.RebeccaPurple);
502
private static uint GetAlternateSystemColorArgb(
KnownColor
color)
505
int index = color <=
KnownColor
.WindowText
507
: (int)color - (int)
KnownColor
.ButtonFace + (int)
KnownColor
.WindowText + 1;
539
public static uint GetSystemColorArgb(
KnownColor
color)
System\Drawing\SystemColors.cs (37)
12
public static Color ActiveBorder => Color.FromKnownColor(
KnownColor
.ActiveBorder);
13
public static Color ActiveCaption => Color.FromKnownColor(
KnownColor
.ActiveCaption);
14
public static Color ActiveCaptionText => Color.FromKnownColor(
KnownColor
.ActiveCaptionText);
15
public static Color AppWorkspace => Color.FromKnownColor(
KnownColor
.AppWorkspace);
17
public static Color ButtonFace => Color.FromKnownColor(
KnownColor
.ButtonFace);
18
public static Color ButtonHighlight => Color.FromKnownColor(
KnownColor
.ButtonHighlight);
19
public static Color ButtonShadow => Color.FromKnownColor(
KnownColor
.ButtonShadow);
21
public static Color Control => Color.FromKnownColor(
KnownColor
.Control);
22
public static Color ControlDark => Color.FromKnownColor(
KnownColor
.ControlDark);
23
public static Color ControlDarkDark => Color.FromKnownColor(
KnownColor
.ControlDarkDark);
24
public static Color ControlLight => Color.FromKnownColor(
KnownColor
.ControlLight);
25
public static Color ControlLightLight => Color.FromKnownColor(
KnownColor
.ControlLightLight);
26
public static Color ControlText => Color.FromKnownColor(
KnownColor
.ControlText);
28
public static Color Desktop => Color.FromKnownColor(
KnownColor
.Desktop);
30
public static Color GradientActiveCaption => Color.FromKnownColor(
KnownColor
.GradientActiveCaption);
31
public static Color GradientInactiveCaption => Color.FromKnownColor(
KnownColor
.GradientInactiveCaption);
32
public static Color GrayText => Color.FromKnownColor(
KnownColor
.GrayText);
34
public static Color Highlight => Color.FromKnownColor(
KnownColor
.Highlight);
35
public static Color HighlightText => Color.FromKnownColor(
KnownColor
.HighlightText);
36
public static Color HotTrack => Color.FromKnownColor(
KnownColor
.HotTrack);
38
public static Color InactiveBorder => Color.FromKnownColor(
KnownColor
.InactiveBorder);
39
public static Color InactiveCaption => Color.FromKnownColor(
KnownColor
.InactiveCaption);
40
public static Color InactiveCaptionText => Color.FromKnownColor(
KnownColor
.InactiveCaptionText);
41
public static Color Info => Color.FromKnownColor(
KnownColor
.Info);
42
public static Color InfoText => Color.FromKnownColor(
KnownColor
.InfoText);
44
public static Color Menu => Color.FromKnownColor(
KnownColor
.Menu);
45
public static Color MenuBar => Color.FromKnownColor(
KnownColor
.MenuBar);
46
public static Color MenuHighlight => Color.FromKnownColor(
KnownColor
.MenuHighlight);
47
public static Color MenuText => Color.FromKnownColor(
KnownColor
.MenuText);
49
public static Color ScrollBar => Color.FromKnownColor(
KnownColor
.ScrollBar);
51
public static Color Window => Color.FromKnownColor(
KnownColor
.Window);
52
public static Color WindowFrame => Color.FromKnownColor(
KnownColor
.WindowFrame);
53
public static Color WindowText => Color.FromKnownColor(
KnownColor
.WindowText);
56
/// When <see langword="true"/>, system <see cref="
KnownColor
"/> values will return
58
/// <see cref="Color.FromKnownColor(
KnownColor
)"/>). This is currently "dark mode"
63
/// <see cref="
KnownColor
"/> <see cref="Color"/> values are always looked up every
68
/// On Windows, system <see cref="
KnownColor
"/> values will always return the current
System.Private.Windows.Core (5)
System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs (2)
245
BindingFlags.Instance | BindingFlags.NonPublic, [typeof(long), typeof(short), typeof(string), typeof(
KnownColor
)]);
255
(
KnownColor
)Convert.ToInt32(classInfo.GetInt16("knownColor"))]);
System\Value.PackedColor.cs (3)
17
private PackedColor(int argb,
KnownColor
knownColor, short state)
48
packedColor = new PackedColor((int)castColor.Argb, (
KnownColor
)castColor.KnownColor, castColor.State);
53
? Color.FromKnownColor((
KnownColor
)_knownColor)
System.Windows.Forms (1)
System\Windows\Forms\Rendering\ControlPaint.cs (1)
401
DrawBorder(graphics, bounds, Color.FromKnownColor(
KnownColor
.WindowFrame), ButtonBorderStyle.Solid);
System.Windows.Forms.Primitives (36)
System\Windows\Forms\GdiPlus\GdiPlusCache.cs (36)
82
private static Brush? BrushFromKnownColor(
KnownColor
color) => color switch
85
KnownColor
.Black => Brushes.Black,
86
KnownColor
.White => Brushes.White,
87
KnownColor
.Gray => Brushes.Gray,
88
KnownColor
.Red => Brushes.Red,
89
KnownColor
.Green => Brushes.Green,
90
KnownColor
.Blue => Brushes.Blue,
91
KnownColor
.Yellow => Brushes.Yellow,
92
KnownColor
.Brown => Brushes.Brown,
93
KnownColor
.LightGray => Brushes.LightGray,
94
KnownColor
.LightGreen => Brushes.LightGreen,
95
KnownColor
.LightBlue => Brushes.LightBlue,
96
KnownColor
.LightYellow => Brushes.LightYellow,
97
KnownColor
.DarkGray => Brushes.DarkGray,
98
KnownColor
.DarkRed => Brushes.DarkRed,
99
KnownColor
.DarkGreen => Brushes.DarkGreen,
100
KnownColor
.DarkBlue => Brushes.DarkBlue,
101
KnownColor
.Transparent => Brushes.Transparent,
105
private static Pen? PenFromKnownColor(
KnownColor
color) => color switch
108
KnownColor
.Black => Pens.Black,
109
KnownColor
.White => Pens.White,
110
KnownColor
.Gray => Pens.Gray,
111
KnownColor
.Red => Pens.Red,
112
KnownColor
.Green => Pens.Green,
113
KnownColor
.Blue => Pens.Blue,
114
KnownColor
.Yellow => Pens.Yellow,
115
KnownColor
.Brown => Pens.Brown,
116
KnownColor
.LightGray => Pens.LightGray,
117
KnownColor
.LightGreen => Pens.LightGreen,
118
KnownColor
.LightBlue => Pens.LightBlue,
119
KnownColor
.LightYellow => Pens.LightYellow,
120
KnownColor
.DarkGray => Pens.DarkGray,
121
KnownColor
.DarkRed => Pens.DarkRed,
122
KnownColor
.DarkGreen => Pens.DarkGreen,
123
KnownColor
.DarkBlue => Pens.DarkBlue,
124
KnownColor
.Transparent => Pens.Transparent,
System.Windows.Forms.Tests (8)
System\Windows\Forms\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapterTests.cs (8)
49
[InlineData(true,
KnownColor
.Window)]
50
[InlineData(false,
KnownColor
.ControlDark)]
51
public void GetOuterBorderColor_ReturnsExpected(bool enabled,
KnownColor
expectedColor)
61
[InlineData(true, true,
KnownColor
.ControlDark)]
62
[InlineData(true, false,
KnownColor
.Window)]
63
[InlineData(false, true,
KnownColor
.ControlDark)]
64
[InlineData(false, false,
KnownColor
.ControlDark)]
65
public void GetPopupOuterBorderColor_ReturnsExpected(bool enabled, bool focused,
KnownColor
expectedColor)