mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Fixed code issues
This commit is contained in:
1 parent
4466acfbf7
commit
7b0e9152fd
54 files changed
+330
-275
No files matched your search
@@ -41,16 +41,13 @@ namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
(double hue, double _, double value) = color.GetHSV();
|
||||
|
||||
if ((hue >= 330) || (hue < 30))
|
||||
return (int)Math.Ceiling(value * 3); // red with brightness 1, 2 or 3
|
||||
|
||||
if ((hue >= 30) && (hue < 90)) // yellow with brightness 17, 34 or 51
|
||||
return (int)Math.Ceiling(value * 3) * 17;
|
||||
|
||||
if ((hue >= 90) && (hue < 150)) // green with brightness 16, 32 or 48
|
||||
return (int)Math.Ceiling(value * 3) * 16;
|
||||
|
||||
return 0;
|
||||
return hue switch
|
||||
{
|
||||
>= 330 or < 30 => (int)Math.Ceiling(value * 3), // red with brightness 1, 2 or 3
|
||||
>= 30 and < 90 => (int)Math.Ceiling(value * 3) * 17, // yellow with brightness 17, 34 or 51
|
||||
>= 90 and < 150 => (int)Math.Ceiling(value * 3) * 16, // green with brightness 16, 32 or 48
|
||||
_ => 0
|
||||
};
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -5,11 +5,10 @@ using Sanford.Multimedia.Midi;
|
||||
namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
/// <inheritdoc cref="UpdateQueue" />
|
||||
/// <inheritdoc cref="IDisposable" />
|
||||
/// <summary>
|
||||
/// Represents the update-queue performing updates for midi devices.
|
||||
/// </summary>
|
||||
public abstract class MidiUpdateQueue : UpdateQueue, IDisposable
|
||||
public abstract class MidiUpdateQueue : UpdateQueue
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
@@ -66,6 +65,8 @@ namespace RGB.NET.Devices.Novation
|
||||
base.Dispose();
|
||||
|
||||
_outputDevice.Dispose();
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user