/// <summary> /// Initializes a new instance of the <see cref="Breathing" /> struct. /// </summary> /// <param name="led">The LED on which to apply the effect.</param> /// <param name="type">The type of breathing effect to create.</param> /// <param name="first">The initial <see cref="Color" /> to use.</param> /// <param name="second">The second color.</param> public Breathing(Led led, BreathingType type, Color first, Color second) { Led = led; Type = type; First = first; Second = second; }
/// <summary> /// Initializes a new instance of the <see cref="Breathing" /> struct. /// </summary> /// <param name="type">The type of breathing effect to create.</param> /// <param name="first">Primary effect color.</param> /// <param name="second">Secondary effect color.</param> /// <param name="parameter">Additional effect parameter to set.</param> public Breathing(BreathingType type, Color first, Color second, int parameter = 0) { Type = type; First = first; Second = second; Parameter = parameter; Size = Marshal.SizeOf(typeof(Breathing)); }
public void ShouldConstructWithCorrectTypeAndColors() { const BreathingType Type = BreathingType.Two; var first = Color.Red; var second = Color.Blue; var effect = new Breathing(Type, first, second); Assert.AreEqual(Type, effect.Type); Assert.AreEqual(first, effect.First); Assert.AreEqual(second, effect.Second); }
public void ShouldConstructWithCorrectParameters() { const Led Led = Led.Logo; const BreathingType Type = BreathingType.Two; var first = Color.Red; var second = Color.Blue; var effect = new Breathing(Led, Type, first, second); Assert.AreEqual(Led, effect.Led); Assert.AreEqual(Type, effect.Type); Assert.AreEqual(first, effect.First); Assert.AreEqual(second, effect.Second); }
public CHROMA_BREATHING(Color primary, Color secondary, string config) : base(primary, 0, 0) { this.secondary = secondary; switch (config) { case "TWO_COLORS": type = BreathingType.TWO_COLORS; break; case "RANDOM_COLORS": type = BreathingType.RANDOM_COLORS; color = Utils.ColorUtils.GenerateRandomColor(); secondary = Utils.ColorUtils.GenerateRandomColor(); break; default: type = BreathingType.INVALID; break; } }
/// <summary> /// Initializes a new instance of the <see cref="Breathing" /> struct. /// </summary> /// <param name="type">The type of breathing effect.</param> /// <param name="first">Initial color.</param> /// <param name="second">Second color.</param> public Breathing(BreathingType type, Color first, Color second) { Type = type; First = first; Second = second; }
/// <summary> /// Initializes a new instance of the <see cref="Breathing" /> struct for /// making every LED on the mouse follow the specified pattern. /// </summary> /// <param name="type">The type of effect to create.</param> /// <param name="first">Initial color.</param> /// <param name="second">Second color.</param> public Breathing(BreathingType type, Color first, Color second) : this(Led.All, type, first, second) { }