1
0
Fork 0
This repository has been archived on 2019-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Galactic_Colors_Control/Galactic Colors Control GUI/Utilities.cs

20 lines
513 B
C#

using System;
namespace Galactic_Colors_Control_GUI
{
internal static class Utilities
{
public static bool DoubleTo(ref double value, double target, double speed)
{
speed = Math.Abs(speed);
bool up = value < target;
value += (up ? 1 : -1) * speed;
if ((up && value >= target) || (!up && value <= target))
{
value = target;
return true;
}
return false;
}
}
}