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); }
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; } }
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); } }
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; }