private void ChangeToCMYK_Click(object sender, RoutedEventArgs e) { CmykColor color = ConvertRgbToCmyk(R.Value.GetValueOrDefault(), G.Value.GetValueOrDefault(), B.Value.GetValueOrDefault()); C.Value = (double)color.C * 100; M.Value = (double)color.M * 100; Y.Value = (double)color.Y * 100; K.Value = (double)color.K * 100; }
private void ColorPicker1_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs <Color?> e) { R.Value = ColorPicker1.SelectedColor.Value.R; G.Value = ColorPicker1.SelectedColor.Value.G; B.Value = ColorPicker1.SelectedColor.Value.B; CmykColor color = ConvertRgbToCmyk(ColorPicker1.SelectedColor.Value.R, ColorPicker1.SelectedColor.Value.G, ColorPicker1.SelectedColor.Value.B); C.Value = (double)color.C * 100; M.Value = (double)color.M * 100; Y.Value = (double)color.Y * 100; K.Value = (double)color.K * 100; }