コード例 #1
0
 private Color[] GetDonutColors()
 {
     Color[] colors = new Color[COLOR_COUNT];
     for (int degree = 0; degree < colors.Length; degree++)
     {
         colors[degree] = new ColorEx.HSB(degree, 100, 100).ToColor();
     }
     return(colors);
 }
コード例 #2
0
 private void numHSB_ValueChanged(object sender, EventArgs e)
 {
     if (_isManualChange == false)
     {
         _isManualChange = true;
         ColorEx.RGB col = new ColorEx.HSB(Hue, Saturation, Brightness).ToRGB();
         _numRed.Value   = col.Red;
         _numGreen.Value = col.Green;
         _numBlue.Value  = col.Blue;
         this.Invalidate(false);
         _isManualChange = false;
     }
 }
コード例 #3
0
 private void DrawTriangle(Graphics g)
 {
     // iterate top to bottom
     for (int y = TriangleY; y < TriangleY + TriangleHeight; y++)
     {
         float  yPercent = (y - TriangleY) / (float)TriangleHeight;
         float  length   = TriangleWidth * yPercent;
         PointF pt1      = new PointF(Center.X - length / 2 - 1, y);
         PointF pt2      = new PointF(Center.X + length / 2 + 1, y);
         Color  col1     = new ColorEx.HSB(Hue, 0, yPercent * 100).ToColor();
         Color  col2     = new ColorEx.HSB(Hue, 100, yPercent * 100).ToColor();
         using (LinearGradientBrush brush = new LinearGradientBrush(pt1, pt2, col1, col2))
             using (Pen pen = new Pen(brush))
                 g.DrawLine(pen, Center.X - length / 2, y, Center.X + length / 2, y);
     }
 }
コード例 #4
0
ファイル: ColorPicker.cs プロジェクト: LRih/Color-Picker
 private void numHSB_ValueChanged(object sender, EventArgs e)
 {
     if (_isManualChange == false)
     {
         _isManualChange = true;
         ColorEx.RGB col = new ColorEx.HSB(Hue, Saturation, Brightness).ToRGB();
         _numRed.Value = col.Red;
         _numGreen.Value = col.Green;
         _numBlue.Value = col.Blue;
         this.Invalidate(false);
         _isManualChange = false;
     }
 }
コード例 #5
0
ファイル: ColorPicker.cs プロジェクト: LRih/Color-Picker
 private Color[] GetDonutColors()
 {
     Color[] colors = new Color[COLOR_COUNT];
     for (int degree = 0; degree < colors.Length; degree++)
         colors[degree] = new ColorEx.HSB(degree, 100, 100).ToColor();
     return colors;
 }
コード例 #6
0
ファイル: ColorPicker.cs プロジェクト: LRih/Color-Picker
 private void DrawTriangle(Graphics g)
 {
     // iterate top to bottom
     for (int y = TriangleY; y < TriangleY + TriangleHeight; y++)
     {
         float yPercent = (y - TriangleY) / (float)TriangleHeight;
         float length = TriangleWidth * yPercent;
         PointF pt1 = new PointF(Center.X - length / 2 - 1, y);
         PointF pt2 = new PointF(Center.X + length / 2 + 1, y);
         Color col1 = new ColorEx.HSB(Hue, 0, yPercent * 100).ToColor();
         Color col2 = new ColorEx.HSB(Hue, 100, yPercent * 100).ToColor();
         using (LinearGradientBrush brush = new LinearGradientBrush(pt1, pt2, col1, col2))
         using (Pen pen = new Pen(brush))
             g.DrawLine(pen, Center.X - length / 2, y, Center.X + length / 2, y);
     }
 }