public override void Execute(IReceivesColor device, ChannelEffectInstance.DeviceType deviceType, IControlToken token) { var currentColor = device.GetCurrentColor(); switch (deviceType) { case ChannelEffectInstance.DeviceType.ColorR: device.SetColor(Color.FromArgb((int)(Brightness * 255), currentColor.G, currentColor.B), 1, token); break; case ChannelEffectInstance.DeviceType.ColorG: device.SetColor(Color.FromArgb(currentColor.R, (int)(Brightness * 255), currentColor.B), 1, token); break; case ChannelEffectInstance.DeviceType.ColorB: device.SetColor(Color.FromArgb(currentColor.R, currentColor.G, (int)(Brightness * 255)), 1, token); break; } }
public override void Execute(IReceivesColor device, ChannelEffectInstance.DeviceType deviceType, IControlToken token) { Executor.Current.MasterEffect.Shimmer(new LogicalDevice.VirtualDevice(b => { var currentColor = device.GetCurrentColor(); switch (deviceType) { case ChannelEffectInstance.DeviceType.ColorR: device.SetColor(Color.FromArgb((int)(b * 255), currentColor.G, currentColor.B), 1, token); break; case ChannelEffectInstance.DeviceType.ColorG: device.SetColor(Color.FromArgb(currentColor.R, (int)(b * 255), currentColor.B), 1, token); break; case ChannelEffectInstance.DeviceType.ColorB: device.SetColor(Color.FromArgb(currentColor.R, currentColor.G, (int)(b * 255)), 1, token); break; } }), StartBrightness, EndBrightness, DurationMs, token: token); }