public void SetMaterialColor() { MaterialDesignColors.Hue swatch = new MaterialDesignColors.Hue("Name", Colors.Red, Colors.Black); modelColor = picker.SelectedColor.Value; material.Brush = new SolidColorBrush(modelColor); }
private static void ReplacePrimaryColor(Swatch swatch, Hue light, Hue mid, Hue dark, IList<Hue> allHues) { foreach (var color in swatch.PrimaryHues) { ReplaceEntry(color.Name, color.Color); ReplaceEntry(color.Name + "Foreground", color.Foreground); } ReplaceEntry("PrimaryHueLightBrush", new SolidColorBrush(light.Color)); ReplaceEntry("PrimaryHueLightForegroundBrush", new SolidColorBrush(light.Foreground)); ReplaceEntry("PrimaryHueMidBrush", new SolidColorBrush(mid.Color)); ReplaceEntry("PrimaryHueMidForegroundBrush", new SolidColorBrush(mid.Foreground)); ReplaceEntry("PrimaryHueDarkBrush", new SolidColorBrush(dark.Color)); ReplaceEntry("PrimaryHueDarkForegroundBrush", new SolidColorBrush(dark.Foreground)); //mahapps brushes ReplaceEntry("HighlightBrush", new SolidColorBrush(dark.Color)); ReplaceEntry("AccentColorBrush", new SolidColorBrush(dark.Color)); ReplaceEntry("AccentColorBrush2", new SolidColorBrush(mid.Color)); ReplaceEntry("AccentColorBrush3", new SolidColorBrush(light.Color)); ReplaceEntry("AccentColorBrush4", new SolidColorBrush(light.Color) { Opacity = .82 }); ReplaceEntry("WindowTitleColorBrush", new SolidColorBrush(dark.Color)); ReplaceEntry("AccentSelectedColorBrush", new SolidColorBrush(dark.Foreground)); ReplaceEntry("ProgressBrush", new LinearGradientBrush(dark.Color, mid.Color, 90.0)); ReplaceEntry("CheckmarkFill", new SolidColorBrush(dark.Color)); ReplaceEntry("RightArrowFill", new SolidColorBrush(dark.Color)); ReplaceEntry("IdealForegroundColorBrush", new SolidColorBrush(dark.Foreground)); ReplaceEntry("IdealForegroundDisabledBrush", new SolidColorBrush(dark.Color) { Opacity = .4 }); }