Merge claudedo/9a0fd00eaf164f3883e4a9e7e28ac99f
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public static class AccentPresetService
|
||||
{
|
||||
public static void Apply(AccentPreset preset)
|
||||
{
|
||||
if (Application.Current is not { } app) return;
|
||||
|
||||
SetBrushColor(app, "AccentBrush", preset.Accent);
|
||||
SetBrushColor(app, "AccentDimBrush", preset.Dim);
|
||||
SetBrushColor(app, "AccentSoftBrush", preset.Soft);
|
||||
SetBrushColor(app, "AccentGlowBrush", preset.Glow);
|
||||
SetBrushColor(app, "MossBrush", preset.Accent);
|
||||
}
|
||||
|
||||
private static void SetBrushColor(Application app, string key, string hex)
|
||||
{
|
||||
if (app.TryGetResource(key, null, out var value) && value is SolidColorBrush brush)
|
||||
brush.Color = Color.Parse(hex);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user