Skip to content

Commit bf065a2

Browse files
authored
feat(controls): Add systemAccentColor parameter to Apply method (#1584)
1 parent 0952c34 commit bf065a2

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Wpf.Ui/Appearance/ApplicationAccentColorManager.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ public static Color TertiaryAccent
158158
/// <param name="systemAccent">Primary accent color.</param>
159159
/// <param name="applicationTheme">If <see cref="ApplicationTheme.Dark"/>, the colors will be different.</param>
160160
/// <param name="systemGlassColor">If the color is taken from the Glass Color System, its brightness will be increased with the help of the operations on HSV space.</param>
161+
/// <param name="systemAccentColor">If the color is the system accent color.</param>
161162
public static void Apply(
162163
Color systemAccent,
163164
ApplicationTheme applicationTheme = ApplicationTheme.Light,
164-
bool systemGlassColor = false
165+
bool systemGlassColor = false,
166+
bool systemAccentColor = false
165167
)
166168
{
167169
if (systemGlassColor)
@@ -170,7 +172,6 @@ public static void Apply(
170172
systemAccent = systemAccent.UpdateBrightness(6f);
171173
}
172174

173-
bool isSystemAccent = systemAccent == GetColorizationColor();
174175
Color primaryAccent;
175176
Color secondaryAccent;
176177
Color tertiaryAccent;
@@ -192,7 +193,7 @@ public static void Apply(
192193

193194
Color GetColor(UIColorType colorType, float brightnessFactor, float saturationFactor = 0.0f)
194195
{
195-
if (isSystemAccent && GetUiColor(colorType) is { } color)
196+
if (systemAccentColor && GetUiColor(colorType) is { } color)
196197
{
197198
return color;
198199
}
@@ -229,7 +230,7 @@ Color tertiaryAccent
229230
/// </summary>
230231
public static void ApplySystemAccent()
231232
{
232-
Apply(GetColorizationColor(), ApplicationThemeManager.GetAppTheme());
233+
Apply(GetColorizationColor(), ApplicationThemeManager.GetAppTheme(), systemAccentColor: true);
233234
}
234235

235236
/// <summary>

0 commit comments

Comments
 (0)