Пример #1
0
 private void SetARGB(ColorHandler.ARGB ARGB)
 {
     // Update the RGB values on the form.
       RefreshValue(hsbAlpha, ARGB.Alpha);
       RefreshValue(hsbRed, ARGB.Red);
       RefreshValue(hsbBlue, ARGB.Blue);
     RefreshValue(hsbGreen, ARGB.Green);
     SetARGBLabels(ARGB);
 }
Пример #2
0
 private void SetARGBLabels(ColorHandler.ARGB ARGB)
 {
     RefreshText(lblAlpha, ARGB.Alpha);
       RefreshText(lblRed, ARGB.Red);
       RefreshText(lblBlue, ARGB.Blue);
     RefreshText(lblGreen, ARGB.Green);
 }
Пример #3
0
 private void SetAHSV( ColorHandler.AHSV AHSV)
 {
     // Update the HSV values on the form.
     RefreshValue(hsbHue, AHSV.Hue);
     RefreshValue(hsbSaturation, AHSV.Saturation);
     RefreshValue(hsbBrightness, AHSV.Value);
     SetAHSVLabels(AHSV);
 }
Пример #4
0
 private void SetAHSVLabels(ColorHandler.AHSV AHSV)
 {
     RefreshText(lblHue, AHSV.Hue);
     RefreshText(lblSaturation, AHSV.Saturation);
     RefreshText(lblBrightness, AHSV.Value);
 }
Пример #5
0
 public ColorChangedEventArgs(ColorHandler.ARGB RGB, ColorHandler.AHSV HSV)
 {
     mRGB = RGB;
       mHSV = HSV;
 }
Пример #6
0
        private void CalcCoordsAndUpdate(ColorHandler.AHSV AHSV)
        {
            // Convert color to real-world coordinates and then calculate
              // the various points. AHSV.Hue represents the degrees (0 to 360),
              // AHSV.Saturation represents the radius.
              // This procedure doesn't draw anything--it simply
              // updates class-level variables. The UpdateDisplay
              // procedure uses these values to update the screen.

              // Given the angle (AHSV.Hue), and distance from
              // the center (AHSV.Saturation), and the center,
              // calculate the point corresponding to
              // the selected color, on the color wheel.
              colorPoint = GetPoint((double)AHSV.Hue / 255 * 360,
            (double)AHSV.Saturation / 255 * radius,
            centerPoint);

              // Given the brightness (AHSV.value), calculate the
              // point corresponding to the brightness indicator.
              brightnessPoint = CalcBrightnessPoint(AHSV.Value);

              // Store information about the selected color.
              brightness = AHSV.Value;
              selectedColor = ColorHandler.AHSVtoColor(AHSV);
              ARGB = ColorHandler.AHSVtoARGB(AHSV);

              // The full color is the same as AHSV, except that the
              // brightness is set to full (255). This is the top-most
              // color in the brightness gradient.
              fullColor = ColorHandler.AHSVtoColor(AHSV.Alpha, AHSV.Hue, AHSV.Saturation, 255);

              // Given the brightness (AHSV.value), calculate the
              // point corresponding to the alpha indicator.
              alphaPoint = CalcAlphaPoint(AHSV.Alpha);

              // Store information about the selected color.
              alpha = AHSV.Alpha;
        }
Пример #7
0
 protected void OnColorChanged(ColorHandler.ARGB RGB, ColorHandler.AHSV AHSV)
 {
     ColorChangedEventArgs e = new ColorChangedEventArgs(RGB, AHSV);
       ColorChanged(this, e);
 }
Пример #8
0
 public void Draw(Graphics g, ColorHandler.ARGB ARGB)
 {
     // Given RGB values, calculate AHSV and then update the screen.
       this.g = g;
       this.AHSV = ColorHandler.ARGBtoAHSV(ARGB);
       CalcCoordsAndUpdate(this.AHSV);
       UpdateDisplay();
 }
Пример #9
0
 public void Draw(Graphics g, ColorHandler.AHSV AHSV)
 {
     // Given AHSV values, update the screen.
       this.g = g;
       this.AHSV = AHSV;
       CalcCoordsAndUpdate(this.AHSV);
       UpdateDisplay();
 }