public void Draw(Graphics g, ColorHandler.RGB RGB)
 {
     // Given RGB values, calculate HSV and then update the screen.
     this.g   = g;
     this.HSV = ColorHandler.RGBtoHSV(RGB);
     CalcCoordsAndUpdate(this.HSV);
     UpdateDisplay();
 }
Beispiel #2
0
 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 ColorHandler.RGB((int)nudRed.Value, (int)nudGreen.Value, (int)nudBlue.Value);
         SetHSV(ColorHandler.RGBtoHSV(RGB));
         this.Invalidate();
     }
 }