示例#1
0
 /// <summary>
 /// Fade multiple RGB-Values"
 /// </summary>
 /// <param name="oldValues">List of old values to fade from</param>
 /// <param name="newValues">List of new values to fade to</param>
 /// <param name="fade_time_ms">Time to sleep between each fade iteration</param>
 public void Fade(RGBValue[] oldValues, RGBValue[] newValues, int fade_time_ms = 50)
 {
     while (!RGBValue.Equals(oldValues, newValues) && _pauseEvent.WaitOne())
     {
         for (int i = 0; i < newValues.Length; i++)
         {
             oldValues[i] = GetNextFadeIteration(oldValues[i], newValues[i]);
         }
         _rgbOutput.ShowRGBs(oldValues);
         Thread.Sleep(fade_time_ms);
     }
 }
示例#2
0
        /// <summary>
        /// Fade a single RGB-Value
        /// </summary>
        /// <param name="oldValues">Old value to fade from</param>
        /// <param name="newValues">New Values to fade to</param>
        /// <param name="fade_time_ms">Time to sleedpbetween each fade iteration</param>
        public void Fade(RGBValue oldValue, RGBValue newValue, int fade_time_ms = 50)
        {
            RGBValue lastRGB = new RGBValue();

            lastRGB.CopyValues(oldValue);

            while (!lastRGB.Equals(newValue) && _pauseEvent.WaitOne())
            {
                lastRGB = GetNextFadeIteration(lastRGB, newValue);

                _rgbOutput.ShowRGB(lastRGB);
                Thread.Sleep(fade_time_ms);
            }
        }