Chromatics.Chromatics.transitionConst C# (CSharp) Method

transitionConst() private method

private transitionConst ( Corale col1, Corale col2, bool forward, int speed ) : void
col1 Corale
col2 Corale
forward bool
speed int
return void
        private void transitionConst(Corale.Colore.Core.Color col1, Corale.Colore.Core.Color col2, bool forward, int speed)
        {
            lock (_transitionConst)
            {
                int i = 1;
                while (state == 6 || skyWatcher.Enabled == true)
                {
                    CTS.Token.ThrowIfCancellationRequested();
                    if (i == 1)
                    {
                        for (uint c = 0; c < Corale.Colore.Razer.Keyboard.Constants.MaxColumns; c++)
                        {
                            for (uint r = 0; r < Corale.Colore.Razer.Keyboard.Constants.MaxRows; r++)
                            {
                                if (state != 6) { break; }
                                var row = (forward) ? r : Corale.Colore.Razer.Keyboard.Constants.MaxRows - r - 1;
                                var colu = (forward) ? c : Corale.Colore.Razer.Keyboard.Constants.MaxColumns - c - 1;
                                try
                                {
                                    Keyboard.Instance[row, colu] = Corale.Colore.Core.Color.FromSystemColor(col1);
                                }
                                catch (Exception ex)
                                {
                                    Debug.WriteLine(ex.Message);
                                }

                            }
                            Thread.Sleep(speed);
                        }
                        i = 2;
                    }
                    else if (i == 2)
                    {
                        for (uint c = 0; c < Corale.Colore.Razer.Keyboard.Constants.MaxColumns; c++)
                        {
                            for (uint r = 0; r < Corale.Colore.Razer.Keyboard.Constants.MaxRows; r++)
                            {
                                if (state != 6) { break; }
                                var row = (forward) ? r : Corale.Colore.Razer.Keyboard.Constants.MaxRows - r - 1;
                                var colu = (forward) ? c : Corale.Colore.Razer.Keyboard.Constants.MaxColumns - c - 1;
                                try
                                {
                                    Keyboard.Instance[row, colu] = Corale.Colore.Core.Color.FromSystemColor(col2);
                                }
                                catch (Exception ex)
                                {
                                    Debug.WriteLine(ex.Message);
                                }
                            }
                            Thread.Sleep(speed);
                        }
                        i = 1;
                    }
                }
            }
        }
Chromatics