Skip to content

Commit 254eeac

Browse files
Update ButtonDarkModeRenderer.
1 parent b0345ec commit 254eeac

File tree

4 files changed

+454
-682
lines changed

4 files changed

+454
-682
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
namespace System.Windows.Forms;
5+
6+
internal static partial class ButtonDarkModeRenderer
7+
{
8+
/// <summary>Cache of colors for different button states</summary>
9+
private static class DarkModeButtonColors
10+
{
11+
// Normal Button (non-default)
12+
/// <summary>Button background color for normal state (#2B2B2B)</summary>
13+
public static Color NormalBackgroundColor => Color.FromArgb(43, 43, 43);
14+
15+
/// <summary>Button background color for hover state (#3B3B3B)</summary>
16+
public static Color HoverBackgroundColor => Color.FromArgb(59, 59, 59);
17+
18+
/// <summary>Button background color for pressed state (#4B4B4B)</summary>
19+
public static Color PressedBackgroundColor => Color.FromArgb(75, 75, 75);
20+
21+
/// <summary>Button background color for disabled state (#252525)</summary>
22+
public static Color DisabledBackgroundColor => Color.FromArgb(37, 37, 37);
23+
24+
// Default Button
25+
/// <summary>Default button background color (#6B2FBF)</summary>
26+
public static Color DefaultBackgroundColor => Color.FromArgb(107, 47, 191);
27+
28+
/// <summary>Default button hover background color (#7C3FD0)</summary>
29+
public static Color DefaultHoverBackgroundColor => Color.FromArgb(124, 63, 208);
30+
31+
/// <summary>Default button pressed background color (#5B1FAF)</summary>
32+
public static Color DefaultPressedBackgroundColor => Color.FromArgb(91, 31, 175);
33+
34+
/// <summary>Default button disabled background color (desaturated accent)</summary>
35+
public static Color DefaultDisabledBackgroundColor => Color.FromArgb(85, 40, 140);
36+
37+
// Text Colors
38+
/// <summary>Normal text color (#E0E0E0)</summary>
39+
public static Color NormalTextColor => Color.FromArgb(224, 224, 224);
40+
41+
/// <summary>Default button text color (#FFFFFF)</summary>
42+
public static Color DefaultTextColor => Color.White;
43+
44+
/// <summary>Disabled text color (~40% opacity, #606060)</summary>
45+
public static Color DisabledTextColor => Color.FromArgb(96, 96, 96);
46+
47+
// Border Colors
48+
/// <summary>Button single border color (#555555)</summary>
49+
public static Color SingleBorderColor => Color.FromArgb(85, 85, 85);
50+
51+
/// <summary>Button top-left border color (#555555)</summary>
52+
public static Color TopLeftBorderColor => Color.FromArgb(85, 85, 85);
53+
54+
/// <summary>Button bottom-right border color (#222222)</summary>
55+
public static Color BottomRightBorderColor => Color.FromArgb(34, 34, 34);
56+
57+
// Focus Colors
58+
/// <summary>Focus indicator color (#AAAAAA)</summary>
59+
public static Color FocusIndicatorColor => Color.FromArgb(170, 170, 170);
60+
61+
/// <summary>Default button focus indicator color (#FFFFFF)</summary>
62+
public static Color DefaultFocusIndicatorColor => Color.White;
63+
}
64+
}

0 commit comments

Comments
 (0)