fix issues with new UI, add color profiles, add sdr brightness for AMD

This commit is contained in:
Vincent Maas committed 2024-09-01 16:24:05 +02:00
1 parent 4d2ca8a552
commit f42a46e53f
95 files changed
+12129 -10005

No files matched your search

@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
using System.Security.Cryptography;
namespace ColorControl.UI.Generics;
public static class GeneralExtensions
{
public static async ValueTask<TValue?> TryGet<TValue>(this ProtectedBrowserStorage storage, string key, TValue? def = default)
{
try
{
var result = await storage.GetAsync<TValue>(key);
var value = result.Success ? result.Value : def;
return value;
}
catch (CryptographicException)
{
await storage.DeleteAsync(key);
return def;
}
}
}