private void linkBg_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var dialog = new ColorDialog(); if (dialog.ShowDialog(this) != DialogResult.OK) { return; } var color = dialog.Color; lbBg.Text = string.Format("#{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B); ThemeUtil.Get(ThemeType.Custom).BackColor = Settings.Theme.CustomBackColor = btnThemeCustom.BackColor = color; }
private void ThemeForm_Load(object sender, EventArgs e) { trOpacity.Value = Settings.Theme.Opacity; // 加载自定义颜色 var theme = ThemeUtil.Get(ThemeType.Custom); if (theme.IsEmpty) { return; } btnThemeCustom.ForeColor = theme.ForeColor; btnThemeCustom.BackColor = theme.BackColor; lbFg.Text = string.Format("#{0:X2}{1:X2}{2:X2}", theme.ForeColor.R, theme.ForeColor.G, theme.ForeColor.B); lbBg.Text = string.Format("#{0:X2}{1:X2}{2:X2}", theme.BackColor.R, theme.BackColor.G, theme.BackColor.B); }