Files
ReminderOrganizer/Core/Theme.cs

58 lines
2.2 KiB
C#
Raw Normal View History

#nullable enable
using System.Windows;
using System.Windows.Media;
namespace ReminderOrganizer.Core
{
/// <summary>One place for the light/dark palette – used by the main window and all dialogs.</summary>
public static class Theme
{
private static SolidColorBrush B(uint rgb)
{
var b = new SolidColorBrush(Color.FromRgb((byte)(rgb >> 16), (byte)(rgb >> 8), (byte)rgb));
b.Freeze();
return b;
}
public static void Apply(ResourceDictionary res, bool dark)
{
if (dark)
{
res["SidebarBrush"] = B(0x1A1A24);
res["CardBrush"] = B(0x22222E);
res["TextPrimaryBrush"] = B(0xF5F5F5);
res["TextSecondaryBrush"] = B(0xA8A8BC);
res["BorderBrush"] = B(0x3A3A4A);
res["BackgroundBrush"] = B(0x121218);
res["HoverBrush"] = B(0x2A2A3A);
res["SidebarTextBrush"] = B(0xF5F5F5);
res["SidebarSecondaryBrush"] = B(0x9999AA);
res["MenuBackgroundBrush"] = B(0x22222E);
res["PrimaryLightBrush"] = B(0x37345F);
res["HeaderBrush"] = B(0x22222E);
res["InputBackgroundBrush"] = B(0x2A2A38);
res["BadgeBrush"] = B(0x37345F);
res["BadgeTextBrush"] = B(0xC7C8FF);
}
else
{
res["SidebarBrush"] = B(0xF8FAFC);
res["CardBrush"] = B(0xFFFFFF);
res["TextPrimaryBrush"] = B(0x1E293B);
res["TextSecondaryBrush"] = B(0x64748B);
res["BorderBrush"] = B(0xE2E8F0);
res["BackgroundBrush"] = B(0xF1F5F9);
res["HoverBrush"] = B(0xE2E8F0);
res["SidebarTextBrush"] = B(0x1E293B);
res["SidebarSecondaryBrush"] = B(0x64748B);
res["MenuBackgroundBrush"] = B(0xFFFFFF);
res["PrimaryLightBrush"] = B(0xEEF2FF);
res["HeaderBrush"] = B(0xFFFFFF);
res["InputBackgroundBrush"] = B(0xF1F5F9);
res["BadgeBrush"] = B(0xE0E7FF);
res["BadgeTextBrush"] = B(0x4338CA);
}
}
}
}