private void Shutdown(ReadOnlySpan <byte> span) { _excluded.Clear(); _colors.Clear(); DeviceType = LogiSetTargetDeviceType.All; BackgroundColor = SKColors.Empty; _logger.Information("LogiLedShutdown: {name}", Encoding.UTF8.GetString(span)); ColorsUpdated?.Invoke(this, EventArgs.Empty); }
private void SetLighting(ReadOnlySpan <byte> span) { SKColor color = FromSpan(span); if (DeviceType == LogiSetTargetDeviceType.PerKeyRgb) { foreach (LedId key in _colors.Keys) { _colors[key] = color; } } else { BackgroundColor = color; } _logger.Verbose("SetLighting: {color}", color); ColorsUpdated?.Invoke(this, EventArgs.Empty); }
public void ReloadColors() { string colorSettingCsv = persistentSettings.Load("Colors", "ColorMap"); if (string.IsNullOrWhiteSpace(colorSettingCsv)) { currentColorSet = LcarsColorSet.FromDefaults(); return; } LcarsColorSet holder; try { holder = LcarsColorSet.FromCsv(colorSettingCsv); } catch { holder = LcarsColorSet.FromDefaults(); } currentColorSet = holder; ColorsUpdated?.Invoke(this, null); }