public static async Task SendCommandC(BeatmapEventData data, HSB hsbColor, double brightness, HSB inithsbColor, HSB endhsbColor, double time, bool gradient) { CancellationToken token = LightInfo.token; EntertainmentLayer entLayer = LightInfo.layer; if (gradient == true) { switch (data.value) { case 0: entLayer.GetCenter().SetState(token, null, brightness); break; case 1: entLayer.GetCenter().SetState(token, inithsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.SetState(token, endhsbColor.GetRGB(), 1, TimeSpan.FromSeconds(time)); break; case 5: entLayer.GetCenter().SetState(token, inithsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.SetState(token, endhsbColor.GetRGB(), 1, TimeSpan.FromSeconds(time)); break; } } else { switch (data.value) { case 0: entLayer.GetCenter().SetState(token, null, brightness); break; case 1: entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), 1); break; case 2: entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break; case 3: entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break; case 5: entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), 1); break; case 6: entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break; case 7: entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), 1); await Task.Delay(TimeSpan.FromMilliseconds(20), token); entLayer.GetCenter().SetState(token, hsbColor.GetRGB(), brightness, TimeSpan.FromSeconds(1)); break; } } }