diff --git a/SukiUI.Demo/SukiUIDemoView.axaml b/SukiUI.Demo/SukiUIDemoView.axaml index b91610124..d38b33779 100644 --- a/SukiUI.Demo/SukiUIDemoView.axaml +++ b/SukiUI.Demo/SukiUIDemoView.axaml @@ -93,6 +93,18 @@ + + + + @@ -106,9 +118,11 @@ diff --git a/SukiUI/Models/SukiColorTheme.cs b/SukiUI/Models/SukiColorTheme.cs index 05ac5f862..b00da0c98 100644 --- a/SukiUI/Models/SukiColorTheme.cs +++ b/SukiUI/Models/SukiColorTheme.cs @@ -11,21 +11,34 @@ public record SukiColorTheme public Color Primary { get; } public IBrush PrimaryBrush => new SolidColorBrush(Primary); + + public Color PrimaryDark { get; } + + public IBrush PrimaryDarkBrush => new SolidColorBrush(PrimaryDark); public Color Accent { get; } public IBrush AccentBrush => new SolidColorBrush(Accent); + + public Color AccentDark { get; } + + public IBrush AccentDarkBrush => new SolidColorBrush(AccentDark); // Used in shaders to save calculating them per-frame. internal Color BackgroundPrimary { get; } internal Color BackgroundAccent { get; } internal Color Background { get; } + // dark scale... + private const double dS = 0.5; + public SukiColorTheme(string displayName, Color primary, Color accent) { DisplayName = displayName; Primary = primary; Accent = accent; + PrimaryDark = new Color(primary.A, (byte)(primary.R * dS), (byte)(primary.G * dS), (byte)(primary.B * dS)); + AccentDark = new Color(accent.A, (byte)(accent.R * dS), (byte)(accent.G * dS), (byte)(accent.B * dS)); Background = GetBackgroundColor(Primary); BackgroundPrimary = new Color(primary.A, (byte)(primary.R / 1.3), (byte)(primary.G / 1.3), (byte)(primary.B / 1.3)); BackgroundAccent = new Color(accent.A, (byte)(accent.R / 1.3), (byte)(accent.G / 1.3), (byte)(accent.B / 1.3)); diff --git a/SukiUI/Theme/Button.axaml b/SukiUI/Theme/Button.axaml index 216f78495..686c96907 100644 --- a/SukiUI/Theme/Button.axaml +++ b/SukiUI/Theme/Button.axaml @@ -70,6 +70,7 @@ + @@ -114,7 +115,15 @@ + + @@ -179,14 +188,7 @@ + + @@ -257,7 +258,6 @@ - @@ -284,6 +284,12 @@ + + + @@ -342,6 +351,14 @@ + + + + + + + diff --git a/SukiUI/Theme/Index.axaml.cs b/SukiUI/Theme/Index.axaml.cs index 1289c9e14..b4ad05912 100644 --- a/SukiUI/Theme/Index.axaml.cs +++ b/SukiUI/Theme/Index.axaml.cs @@ -162,7 +162,9 @@ private void SetColorThemeResourcesOnColorThemeChanged() private void SetColorTheme(SukiColorTheme colorTheme) { SetColorWithOpacities("SukiPrimaryColor", colorTheme.Primary); + SetResource("SukiPrimaryDarkColor", colorTheme.PrimaryDark); SetColorWithOpacities("SukiAccentColor", colorTheme.Accent); + SetResource("SukiAccentDarkColor", colorTheme.AccentDark); ActiveColorTheme = colorTheme; OnColorThemeChanged?.Invoke(ActiveColorTheme); }