Skip to content

Commit b905201

Browse files
committed
dont pick random mahapps colours when switching palettes
1 parent b90e113 commit b905201

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

MaterialDesignThemes.Wpf/PaletteHelper.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,18 @@ private static void ReplacePrimaryColor(Swatch swatch, Hue light, Hue mid, Hue d
183183

184184
//mahapps brushes
185185
ReplaceEntry("HighlightBrush", new SolidColorBrush(dark.Color));
186-
ReplaceEntry("AccentColorBrush", new SolidColorBrush(allHues[5].Color));
187-
ReplaceEntry("AccentColorBrush2", new SolidColorBrush(allHues[4].Color));
188-
ReplaceEntry("AccentColorBrush3", new SolidColorBrush(allHues[3].Color));
189-
ReplaceEntry("AccentColorBrush4", new SolidColorBrush(allHues[2].Color));
186+
ReplaceEntry("AccentColorBrush", new SolidColorBrush(dark.Color));
187+
ReplaceEntry("AccentColorBrush2", new SolidColorBrush(mid.Color));
188+
ReplaceEntry("AccentColorBrush3", new SolidColorBrush(light.Color));
189+
ReplaceEntry("AccentColorBrush4", new SolidColorBrush(light.Color) { Opacity = .82 });
190190
ReplaceEntry("WindowTitleColorBrush", new SolidColorBrush(dark.Color));
191-
ReplaceEntry("AccentSelectedColorBrush", new SolidColorBrush(allHues[5].Foreground));
192-
ReplaceEntry("ProgressBrush", new LinearGradientBrush(dark.Color, allHues[3].Color, 90.0));
193-
ReplaceEntry("CheckmarkFill", new SolidColorBrush(allHues[5].Color));
194-
ReplaceEntry("RightArrowFill", new SolidColorBrush(allHues[5].Color));
195-
ReplaceEntry("IdealForegroundColorBrush", new SolidColorBrush(allHues[5].Foreground));
191+
ReplaceEntry("AccentSelectedColorBrush", new SolidColorBrush(dark.Foreground));
192+
ReplaceEntry("ProgressBrush", new LinearGradientBrush(dark.Color, mid.Color, 90.0));
193+
ReplaceEntry("CheckmarkFill", new SolidColorBrush(dark.Color));
194+
ReplaceEntry("RightArrowFill", new SolidColorBrush(dark.Color));
195+
ReplaceEntry("IdealForegroundColorBrush", new SolidColorBrush(dark.Foreground));
196196
ReplaceEntry("IdealForegroundDisabledBrush", new SolidColorBrush(dark.Color) { Opacity = .4 });
197-
}
197+
}
198198

199199
private static int GetHueIndex(Swatch swatch, Color color, bool isAccent)
200200
{

0 commit comments

Comments
 (0)