Skip to content

Commit b904cbf

Browse files
committed
resourcify hard light/dark colours. fixes #221
1 parent 204c547 commit b904cbf

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,12 @@
430430
<Setter Property="Foreground" Value="{DynamicResource SecondaryAccentForegroundBrush}" />
431431
</Trigger>
432432
<Trigger Property="Mode" Value="Light">
433-
<Setter Property="Background" Value="#FFfafafa" />
434-
<Setter Property="Foreground" Value="#DD000000" />
433+
<Setter Property="Background" Value="{DynamicResource MaterialDesignLightBackground}" />
434+
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignLightForeground}" />
435435
</Trigger>
436436
<Trigger Property="Mode" Value="Dark">
437-
<Setter Property="Background" Value="#FF37474f" />
438-
<Setter Property="Foreground" Value="#DDFFFFFF" />
437+
<Setter Property="Background" Value="{DynamicResource MaterialDesignDarkBackground}" />
438+
<Setter Property="Foreground" Value="{DynamicResource MaterialDesignDarkForeground}" />
439439
</Trigger>
440440
</Style.Triggers>
441441
</Style>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Defaults.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TreeView.xaml" />
3535
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ValidationErrorTemplate.xaml" />
3636
</ResourceDictionary.MergedDictionaries>
37+
<SolidColorBrush x:Key="MaterialDesignLightBackground" Color="#FFFAFAFA"/>
38+
<SolidColorBrush x:Key="MaterialDesignLightForeground" Color="#DD000000"/>
39+
<SolidColorBrush x:Key="MaterialDesignDarkBackground" Color="#FF37474f"/>
40+
<SolidColorBrush x:Key="MaterialDesignDarkForeground" Color="#DDFFFFFF"/>
3741
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignRaisedButton}" />
3842
<Style TargetType="{x:Type Calendar}" BasedOn="{StaticResource MaterialDesignCalendarPortrait}" />
3943
<Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource MaterialDesignCheckBox}" />

0 commit comments

Comments
 (0)