//set random gradient color private void button4_Click(object sender, EventArgs e) { Color one = ts.RandomColor(); Color two = ts.RandomColor(); List <Color> colooren = ColorManipulations.GetGradientColors(one, two, NUMBER_OF_LEDS + 1); currentColor = colooren; write_color_stream(colooren); }
//set single color private void button2_Click(object sender, EventArgs e) { if (colorDialog1.ShowDialog() == DialogResult.OK) { List <Color> colooren = ColorManipulations.GetGradientColors(colorDialog1.Color, colorDialog1.Color, NUMBER_OF_LEDS + 1); currentColor = colooren; apply_color.BackColor = colorDialog1.Color; } }
//set gradient color private void button3_Click(object sender, EventArgs e) { if (colorDialog1.ShowDialog() == DialogResult.OK) { Color one, two; one = colorDialog1.Color; if (colorDialog1.ShowDialog() == DialogResult.OK) { two = colorDialog1.Color; List <Color> colooren = ColorManipulations.GetGradientColors(one, two, NUMBER_OF_LEDS + 1); currentColor = colooren; write_color_stream(colooren); } } }
private void timer1_Tick(object sender, EventArgs e) { Point cursor = new Point(); ColorManipulations.GetCursorPos(ref cursor); Color c = ColorManipulations.GetColorAt(cursor); this.BackColor = c; if (c != prevColor) { prevColor = c; List <Color> colooren = ColorManipulations.GetGradientColors(c, c, NUMBER_OF_LEDS + 1); write_color_stream(colooren); } }
private void button7_Click(object sender, EventArgs e) { List <Color> colooren = ColorManipulations.GetGradientColors(Color.FromArgb(0, 0, 0), Color.FromArgb(0, 0, 0), NUMBER_OF_LEDS + 1); write_color_stream(colooren); }