private void cbxColorScheme_SelectedIndexChanged(object sender, EventArgs e) { TangraConfig.LightCurvesColorScheme scheme = (TangraConfig.LightCurvesColorScheme)cbxColorScheme.SelectedIndex; SetColorScheme(scheme); if (!m_DontApplySettingsBack) { Preview(); } }
private void SetColorScheme(TangraConfig.LightCurvesColorScheme scheme) { gbColors.Enabled = scheme == TangraConfig.LightCurvesColorScheme.Custom; bool dontApplySettingsBack = m_DontApplySettingsBack; m_DontApplySettingsBack = true; try { if (scheme == TangraConfig.LightCurvesColorScheme.Clasic) { cpBackground.SelectedColor = Color.FromArgb(128, 128, 128); cpGrid.SelectedColor = Color.FromArgb(180, 180, 180); cpLabels.SelectedColor = Color.White; cbxTangraTargetColors.Checked = true; m_DisplaySettings.ColorScheme = TangraConfig.LightCurvesColorScheme.Clasic; } else if (scheme == TangraConfig.LightCurvesColorScheme.Pastel) { cpBackground.SelectedColor = Color.FromArgb(237, 240, 241); cpGrid.SelectedColor = Color.FromArgb(180, 180, 180); cpLabels.SelectedColor = Color.Navy; cbxTangraTargetColors.Checked = false; cpTarget1.SelectedColor = Color.FromArgb(124, 194, 240); cpTarget2.SelectedColor = Color.FromArgb(255, 102, 89); cpTarget3.SelectedColor = Color.FromArgb(133, 221, 161); cpTarget4.SelectedColor = Color.FromArgb(255, 187, 99); m_DisplaySettings.ColorScheme = TangraConfig.LightCurvesColorScheme.Pastel; } else if (scheme == TangraConfig.LightCurvesColorScheme.Contrast) { cpBackground.SelectedColor = Color.WhiteSmoke; cpGrid.SelectedColor = Color.DarkGray; cpLabels.SelectedColor = Color.Black; cbxTangraTargetColors.Checked = false; cpTarget1.SelectedColor = Color.Blue; cpTarget2.SelectedColor = Color.Green; cpTarget3.SelectedColor = Color.Magenta; cpTarget4.SelectedColor = Color.FromArgb(0, 0, 64); m_DisplaySettings.ColorScheme = TangraConfig.LightCurvesColorScheme.Contrast; } else if (scheme == TangraConfig.LightCurvesColorScheme.Custom) { m_DisplaySettings.ColorScheme = TangraConfig.LightCurvesColorScheme.Custom; cbxTangraTargetColors.Checked = m_DisplaySettings.UseTangraTargetColors; if (!cbxTangraTargetColors.Checked) { cpTarget1.SelectedColor = m_DisplaySettings.Target1Color; cpTarget2.SelectedColor = m_DisplaySettings.Target2Color; cpTarget3.SelectedColor = m_DisplaySettings.Target3Color; cpTarget4.SelectedColor = m_DisplaySettings.Target4Color; } } m_DisplaySettings.UseTangraTargetColors = cbxTangraTargetColors.Checked; m_DisplaySettings.Target1Color = cpTarget1.SelectedColor; m_DisplaySettings.Target2Color = cpTarget2.SelectedColor; m_DisplaySettings.Target3Color = cpTarget3.SelectedColor; m_DisplaySettings.Target4Color = cpTarget4.SelectedColor; } finally { m_DontApplySettingsBack = dontApplySettingsBack; } }