From 4fd087b19bdb4d1805b03343086c3653e145559d Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sat, 17 Feb 2024 14:20:54 +0100 Subject: [PATCH] Stronger dimming --- app/Display/DisplayGammaRamp.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Display/DisplayGammaRamp.cs b/app/Display/DisplayGammaRamp.cs index 5ff71672..ca150f6f 100644 --- a/app/Display/DisplayGammaRamp.cs +++ b/app/Display/DisplayGammaRamp.cs @@ -82,11 +82,13 @@ private static ushort[] Brightness(ushort[] data, double brightness) { - brightness = 0.5 + brightness / 2; var result = new ushort[GammaRamp.DataPoints]; for (var i = 0; i < result.Length; i++) { - result[i] = (ushort)(data[i] * brightness); + if (brightness < 0.5) + result[i] = (ushort)(0.5 * ushort.MaxValue * Math.Pow((float)i/(result.Length - 1), 2 - brightness*2)); + else + result[i] = (ushort)(data[i] * brightness); } return result; }