using System; using RGB.NET.Core; using RGB.NET.Devices.Logitech.Native; namespace RGB.NET.Devices.Logitech { /// /// /// Represents the update-queue performing updates for logitech per-device devices. /// public class LogitechPerDeviceUpdateQueue : UpdateQueue { #region Constructors /// /// Initializes a new instance of the class. /// /// The update trigger used by this queue. public LogitechPerDeviceUpdateQueue(IDeviceUpdateTrigger updateTrigger) : base(updateTrigger) { } #endregion #region Methods /// protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet) { Color color = dataSet[0].color; _LogitechGSDK.LogiLedSetTargetDevice(LogitechDeviceCaps.DeviceRGB); _LogitechGSDK.LogiLedSetLighting((int)Math.Round(color.R * 100), (int)Math.Round(color.G * 100), (int)Math.Round(color.B * 100)); } #endregion } }