示例#1
0
 /// <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;
 }
示例#2
0
 /// <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;
 }
示例#3
0
 /// <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));
 }
示例#4
0
 /// <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));
 }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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;
            }
        }
示例#8
0
 /// <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;
 }
示例#9
0
 /// <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;
 }
示例#10
0
 /// <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)
 {
 }
示例#11
0
 /// <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)
 {
 }