Fully disconnect gamepad handler for rainbow color if configuration is set with UseRainbowLed false
Also check if its even enabled before setting the rainbow color Fixes strobing
This commit is contained in:
@@ -5,17 +5,29 @@ namespace Ryujinx.Common.Utilities
|
||||
{
|
||||
public class Rainbow
|
||||
{
|
||||
public const float Speed = 1;
|
||||
public static float Speed { get; set; } = 1;
|
||||
|
||||
public static Color Color { get; private set; } = Color.Blue;
|
||||
|
||||
private static float _lastHue;
|
||||
|
||||
public static void Tick()
|
||||
{
|
||||
float currentHue = Color.GetHue();
|
||||
float nextHue = currentHue;
|
||||
|
||||
if (currentHue >= 360)
|
||||
nextHue = 0;
|
||||
else
|
||||
nextHue += Speed;
|
||||
|
||||
Color = HsbToRgb(
|
||||
(Color.GetHue() + Speed) / 360,
|
||||
nextHue / 360,
|
||||
1,
|
||||
1
|
||||
);
|
||||
|
||||
_lastHue = currentHue;
|
||||
|
||||
RainbowColorUpdated?.Invoke(Color.ToArgb());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user