Files
2026-11-24 23:40:08 +03:00

29 lines
954 B
C#

using System;
using System.Drawing;
using VibranceHud.Design;
namespace VibranceHud.Theming;
public static class SlatePreferences
{
public readonly record struct Snapshot(int GuiOpacityPercent, bool MatteBlur, int MatteArgb);
public const int NeverChosen = 0;
public static int DefaultOpacityPercent => (int)Math.Round(66.0);
public static Snapshot Defaults => new Snapshot(DefaultOpacityPercent, MatteBlur: true, BackgroundMatte.Default.ToArgb());
public static void Apply(int guiOpacityPercent, bool matteBlur, int matteArgb)
{
SlateSurface.UserOpacity = ((guiOpacityPercent == 0) ? 0.66 : ((double)guiOpacityPercent / 100.0));
SlateSurface.MatteBlur = matteBlur;
AppBackground.SetMatte((matteArgb == 0) ? BackgroundMatte.Default : Color.FromArgb(matteArgb));
}
public static Snapshot Capture()
{
return new Snapshot((int)Math.Round(SlateSurface.UserOpacity * 100.0), SlateSurface.MatteBlur, AppBackground.Matte.ToArgb());
}
}