private void colorPicker_HSVColorChanged(object sender, HSVColorChangedEventArgs e) { Console.WriteLine("Color Changed: " + e); HSVColorPicker.HSVparam hsvColours = colorPicker.HSV; // h: 0 - 6, s: 0 - 1, v: 0 - 1\ // Calculate and send H, S, V values int hue = (int)Math.Round((Math.Max(0, Math.Min(1, (hsvColours.H / 6))) * 255)); int sat = (int)Math.Round(hsvColours.S * 255); int val = (int)Math.Round(hsvColours.V * 255); sendToArduino(new byte[] { 4, (byte)hue, (byte)sat, (byte)val }); }
public HSVColorChangedEventArgs(HSVColorPicker.HSVparam hsv) { this.hsv = hsv; }