mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Reapply brightness on display config change
This commit is contained in:
@@ -47,6 +47,17 @@ namespace GHelper.Display
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBrightness(int brightness = -1)
|
||||
{
|
||||
if (!AppConfig.IsOLED()) return;
|
||||
|
||||
if (brightness >= 0) AppConfig.Set("brightness", brightness);
|
||||
else brightness = AppConfig.Get("brightness");
|
||||
|
||||
if (brightness >= 0) SetGamma(brightness);
|
||||
}
|
||||
|
||||
|
||||
public void SetGamma(int brightness = 100)
|
||||
{
|
||||
var bright = Math.Round((float)brightness / 200 + 0.5, 2);
|
||||
|
||||
Reference in New Issue
Block a user