Пример #1
0
        /// <summary>
        /// Set LED to a Color
        /// </summary>
        /// <param name="ledID">LED to set (0 based)</param>
        /// <param name="color">Color to use</param>
        public void SetLED(int ledID, Color color)
        {
            var cName = StripType.ToString();

            if (cName.Contains("W") && cName.Contains("SK"))
            {
                color = ColorClamp.ClampAlpha(color);
            }
            LEDColors[ledID] = color;
            IsDirty          = true;
        }
Пример #2
0
        /// <summary>
        /// Set all the LEDs in the strip to same color
        /// </summary>
        /// <param name="color">color to set all the LEDs</param>
        public void SetAll(Color color)
        {
            var cName = StripType.ToString();

            if (cName.Contains("W") && cName.Contains("SK"))
            {
                color = ColorClamp.ClampAlpha(color);
            }

            for (var i = 0; i < LEDColors.Length; i++)
            {
                LEDColors[i] = color;
            }
            IsDirty = true;
        }