Improved dimming

This commit is contained in:
Serge
2024-03-06 23:28:21 +01:00
parent 6075676372
commit 2797807d7b
5 changed files with 20 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
using System.Runtime.InteropServices;
using GHelper.Helpers;
using System.Runtime.InteropServices;
namespace GHelper.Display
{
@@ -31,10 +32,16 @@ namespace GHelper.Display
if (brightness >= 0) AppConfig.Set("brightness", brightness);
else brightness = AppConfig.Get("brightness");
if (brightness >= 0) SetGamma(brightness);
if (brightness >= 0) Task.Run(() =>
{
//Logger.WriteLine($"Brightness: {brightness}");
var splendid = Environment.SystemDirectory + "\\DriverStore\\FileRepository\\asussci2.inf_amd64_f2eed2fae3b45a67\\ASUSOptimization\\AsusSplendid.exe";
ProcessHelper.RunCMD(splendid, (AppConfig.IsROG() ? 19 : 9) + " 0 " + (40 + brightness * 0.6));
});
}
public void SetGamma(int brightness = 100)
{
var bright = Math.Round((float)brightness / 200 + 0.5, 2);