public void Draw(Graphics g, ColourHandler.RGB RGB) { // Given RGB values, calculate HSV and then update the screen. this.g = g; this.HSV = ColourHandler.RGBtoHSV(RGB); CalcCoordsAndUpdate(this.HSV); UpdateDisplay(); }
private void HandleRGBScroll(object sender, ScrollEventArgs e) { _changeStyle = ChangeStyle.RGB; _RGB = new ColourHandler.RGB(ksbRed.Value, ksbGreen.Value, ksbBlue.Value); SetHSV(ColourHandler.RGBtoHSV(_RGB)); SetRGBLabels(_RGB); Invalidate(); }
private void HandleRGBScroll(object sender, ScrollEventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. changeType = ChangeStyle.RGB; RGB = new ColourHandler.RGB(ksbRed.Value, ksbGreen.Value, ksbBlue.Value); SetHSV(ColourHandler.RGBtoHSV(RGB)); SetRGBLabels(RGB); this.Invalidate(); }
private void HandleRGBChange(object sender, System.EventArgs e) { // If the R, G, or B values change, use this // code to update the HSV values and invalidate // the color wheel (so it updates the pointers). // Check the isInUpdate flag to avoid recursive events // when you update the NumericUpdownControls. if (!isInUpdate) { changeType = ChangeStyle.RGB; RGB = new ColourHandler.RGB((int)knumRed.Value, (int)knumGreen.Value, (int)knumBlue.Value); SetHSV(ColourHandler.RGBtoHSV(RGB)); this.Invalidate(); } }