private void Color_model_Load(object sender, EventArgs e) { this.updating = true; UpdateHSL(ColorSpaceHelper.RGBtoHSL((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateHSB(ColorSpaceHelper.RGBtoHSB((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateCMYK(ColorSpaceHelper.RGBtoCMYK((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateYUV(ColorSpaceHelper.RGBtoYUV((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); this.updating = false; }
private void HSBValueChanged(object sender, System.EventArgs e) { if (!this.updating) { this.updating = true; UpdateRGB(ColorSpaceHelper.HSBtoRGB((double)this.hUD.Value, (double)this.sUD.Value / 100.0, (double)this.bUD.Value / 100.0)); UpdateHSL(ColorSpaceHelper.RGBtoHSL((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateCMYK(ColorSpaceHelper.RGBtoCMYK((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateYUV(ColorSpaceHelper.RGBtoYUV((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); this.updating = false; } }
private void CMYKValueChanged(object sender, System.EventArgs e) { if (!this.updating) { this.updating = true; UpdateRGB(ColorSpaceHelper.CMYKtoRGB((double)this.cyanUD.Value / 100.0, (double)this.magentaUD.Value / 100.0, (double)this.yellowUD.Value / 100.0, (double)this.blackUD.Value / 100.0)); UpdateHSL(ColorSpaceHelper.RGBtoHSL((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateHSB(ColorSpaceHelper.RGBtoHSB((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateYUV(ColorSpaceHelper.RGBtoYUV((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); this.updating = false; } }
private void RGBValueChanged(object sender, System.EventArgs e) { if (!this.updating) { this.preview.BackColor = Color.FromArgb((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value); this.updating = true; UpdateHSL(ColorSpaceHelper.RGBtoHSL((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateHSB(ColorSpaceHelper.RGBtoHSB((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateCMYK(ColorSpaceHelper.RGBtoCMYK((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); UpdateYUV(ColorSpaceHelper.RGBtoYUV((int)redUD.Value, (int)greenUD.Value, (int)blueUD.Value)); this.updating = false; } }