public static FromString ( String color ) : |
||
color | String | Color string. |
Résultat |
/// <summary> /// Sets the color of the led. /// </summary> /// <param name="channel">Channel (0 - R, 1 - G, 2 - B)</param> /// <param name="index">Index of the LED</param> /// <param name="color">Must be in #rrggbb format or named color ("red", "green", "blue")</param> public void SetColor(byte channel, byte index, string color) { SetColor(channel, index, RgbColor.FromString(color)); }
/// <summary> /// Sets the color of the led. /// </summary> /// <param name="color">Must be in #rrggbb format</param> public void SetColor(String color) { SetColor(RgbColor.FromString(color)); }
/// <summary> /// Morph from current color to new color on BlinkStick Pro. /// </summary> /// <param name="channel">Channel (0 - R, 1 - G, 2 - B)</param> /// <param name="index">Index of the LED</param> /// <param name="color">Must be in #rrggbb format or named color ("red", "green", "blue")</param> /// <param name="duration">How long should the morph last</param> /// <param name="steps">How many steps for color changes</param> public void Morph(byte channel, byte index, string color, int duration = 1000, int steps = 50) { this.Morph(channel, index, RgbColor.FromString(color), duration, steps); }
/// <summary> /// Pulse specified color on BlinkStick Pro. /// </summary> /// <param name="channel">Channel (0 - R, 1 - G, 2 - B)</param> /// <param name="index">Index of the LED</param> /// <param name="color">Must be in #rrggbb format or named color ("red", "green", "blue")</param> /// <param name="duration">How long should the morph last</param> /// <param name="steps">How many steps for color changes</param> public void Pulse(byte channel, byte index, string color, int repeats = 1, int duration = 1000, int steps = 50) { this.Pulse(channel, index, RgbColor.FromString(color), repeats, duration, steps); }
/// <summary> /// Blink the LED on BlinkStick Pro. /// </summary> /// <param name="channel">Channel (0 - R, 1 - G, 2 - B)</param> /// <param name="index">Index of the LED</param> /// <param name="color">Must be in #rrggbb format or named color ("red", "green", "blue")</param> /// <param name="repeats">How many times to repeat (default 1)</param> /// <param name="delay">Delay delay between on/off sequences (default 500)</param> public void Blink(byte channel, byte index, string color, int repeats = 1, int delay = 500) { this.Blink(channel, index, RgbColor.FromString(color), repeats, delay); }