private void panelEdgeTint_Click(object sender, EventArgs e) { // colorDialog1.Color = IOR_to_Color( outputPanelFresnelGraph.IOR_red, outputPanelFresnelGraph.IOR_green, outputPanelFresnelGraph.IOR_blue ); UIUtility.ColorPickerForm colorPicker = new UIUtility.ColorPickerForm(panelSpecularTintEdge.BackColor); colorPicker.ColorChanged += colorPicker_ColorChanged_EdgeTint; colorPicker.ShowDialog(this); }
void colorPicker_ColorChanged(UIUtility.ColorPickerForm _sender) { Color pickedColor = _sender.ColorLDR; panelSpecularTintNormal.BackColor = pickedColor; // floatTrackbarControlIOR.Value = Math.Max( Math.Max( IOR_red, IOR_green ), IOR_blue ); // floatTrackbarControlIOR.VisibleRangeMax = Math.Max( 10.0f, 2.0f * floatTrackbarControlIOR.Value ); // outputPanelFresnelGraph.SpecularTintNormal = pickedColor; float F0_red = pickedColor.R / 255.0f; float F0_green = pickedColor.G / 255.0f; float F0_blue = pickedColor.B / 255.0f; float IOR_red = F0_to_IOR(F0_red); float IOR_green = F0_to_IOR(F0_green); float IOR_blue = F0_to_IOR(F0_blue); outputPanelFresnelGraph.IOR_red = IOR_red; outputPanelFresnelGraph.IOR_green = IOR_green; outputPanelFresnelGraph.IOR_blue = IOR_blue; outputPanelDiffuseFresnelReflectance.IOR = Math.Max(Math.Max(IOR_red, IOR_green), IOR_blue); outputPanelFresnelGraph.Refresh(); }
void colorPicker_ColorChanged_EdgeTint(UIUtility.ColorPickerForm _sender) { Color pickedColor = _sender.ColorLDR; panelSpecularTintEdge.BackColor = pickedColor; outputPanelFresnelGraph.SpecularTintEdge = pickedColor; outputPanelFresnelGraph.Refresh(); }