BlinkStickDotNet.BlinkStick.GetColor C# (CSharp) Метод

GetColor() публичный Метод

Gets the color of the led.
public GetColor ( byte index, byte &r, byte &g, byte &b ) : System.Boolean
index byte
r byte The red component.
g byte The green component.
b byte The blue component.
Результат System.Boolean
        public Boolean GetColor (byte index, out byte r, out byte g, out byte b)
        {
            if (OnReceiveColor(index, out r, out g, out b))
                return true;

            if (index == 0)
            {
                return this.GetColor(out r, out g, out b);
            }

            byte[] colors;
            this.GetColors(out colors);

            if (colors.Length >= (index + 1) * 3)
            {
                r = colors[index * 3 + 1];
                g = colors[index * 3];
                b = colors[index * 3 + 2];

                return true;
            }
            else
            {
                r = 0;
                g = 0;
                b = 0;

                return false;
            }
        }
        #endregion

Same methods

BlinkStick::GetColor ( byte &r, byte &g, byte &b ) : System.Boolean