mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Compare commits
6 Commits
5fc2e34f28
...
02843705a8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02843705a8 | ||
|
|
21b2f774c4 | ||
|
|
ecf880d297 | ||
|
|
e73fb45503 | ||
|
|
06f46811f4 | ||
|
|
7520147ff8 |
@ -12,6 +12,8 @@ namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly IAuraRgbLight[] _lights;
|
||||
|
||||
/// <summary>
|
||||
/// The device to be updated.
|
||||
/// </summary>
|
||||
@ -30,6 +32,10 @@ namespace RGB.NET.Devices.Asus
|
||||
: base(updateTrigger)
|
||||
{
|
||||
this.Device = device;
|
||||
|
||||
this._lights = new IAuraRgbLight[device.Lights.Count];
|
||||
for (int i = 0; i < device.Lights.Count; i++)
|
||||
_lights[i] = device.Lights[i];
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -59,7 +65,7 @@ namespace RGB.NET.Devices.Asus
|
||||
}
|
||||
else
|
||||
{
|
||||
IAuraRgbLight light = keyboard.Lights[id];
|
||||
IAuraRgbLight light = _lights[id];
|
||||
(_, byte r, byte g, byte b) = value.GetRGBBytes();
|
||||
light.Red = r;
|
||||
light.Green = g;
|
||||
@ -72,7 +78,7 @@ namespace RGB.NET.Devices.Asus
|
||||
foreach ((object key, Color value) in dataSet)
|
||||
{
|
||||
int index = (int)key;
|
||||
IAuraRgbLight light = Device.Lights[index];
|
||||
IAuraRgbLight light = _lights[index];
|
||||
|
||||
(_, byte r, byte g, byte b) = value.GetRGBBytes();
|
||||
light.Red = r;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user