mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Use EaseOutQuad curve for idle disconnect led color
Linear seems to have the led blank too quickly towards the end
This commit is contained in:
parent
f0d967cd63
commit
c03c173f31
@ -157,9 +157,12 @@ namespace DS4Windows
|
||||
TimeSpan timeratio = new TimeSpan(DateTime.UtcNow.Ticks - device.lastActive.Ticks);
|
||||
double botratio = timeratio.TotalMilliseconds;
|
||||
double topratio = TimeSpan.FromSeconds(idleDisconnectTimeout).TotalMilliseconds;
|
||||
double ratio = 100.0 * (botratio / topratio);
|
||||
double ratio = 100.0 * (botratio / topratio), elapsed = ratio;
|
||||
if (ratio >= 50.0 && ratio < 100.0)
|
||||
color = getTransitionedColor(color, new DS4Color(0, 0, 0), (uint)((ratio - 50) * 2));
|
||||
{
|
||||
color = getTransitionedColor(color, new DS4Color(0, 0, 0),
|
||||
(uint)(-100.0 * (elapsed = 0.02 * (ratio - 50.0)) * (elapsed - 2.0)));
|
||||
}
|
||||
else if (ratio >= 100.0)
|
||||
color = getTransitionedColor(color, new DS4Color(0, 0, 0), 100.0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user