Ejemplo n.º 1
0
        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;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private Corale.Colore.Razer.Keyboard.Effects.Custom scoringFrames(Corale.Colore.Razer.Keyboard.Effects.Custom effect)
 {
     Array ScoringKeys = Enum.GetValues(typeof(ScoringKeys));
     int fKeysAmount = currentLevel;
     for (int i = 12; i > 0; i--)
     {
         int possibleKey = fKeysAmount - i;
         if (possibleKey == 0)
         {
             ScoringKeys Fkey = (ScoringKeys)ScoringKeys.GetValue(i - 1);
             Key RazerFKey = (Key)Enum.Parse(typeof(Key), Fkey.ToString().ToUpper());
             effect[RazerFKey] = Color.Orange;
             break;
         } else if (possibleKey > 0)
         {
             ScoringKeys Fkey = (ScoringKeys)ScoringKeys.GetValue(i - 1);
             Key RazerFKey = (Key)Enum.Parse(typeof(Key), Fkey.ToString().ToUpper());
             fKeysAmount = possibleKey;
             effect[RazerFKey] = Color.Orange;
         }
     }
     return effect;
 }
Ejemplo n.º 3
0
 private void transition(Corale.Colore.Core.Color col, bool forward)
 {
     lock (_transition)
     {
         for (uint c = 0; c < Corale.Colore.Razer.Keyboard.Constants.MaxColumns; c++)
         {
             for (uint r = 0; r < Corale.Colore.Razer.Keyboard.Constants.MaxRows; r++)
             {
                 var row = (forward) ? r : Corale.Colore.Razer.Keyboard.Constants.MaxRows - r - 1;
                 var colu = (forward) ? c : Corale.Colore.Razer.Keyboard.Constants.MaxColumns - c - 1;
                 Keyboard.Instance[row, colu] = Corale.Colore.Core.Color.FromSystemColor(col);
             }
             Thread.Sleep(15);
         }
     }
 }
Ejemplo n.º 4
0
 public static System.Drawing.Color Colore2Drawing(Corale.Colore.Core.Color c)
 {
     return System.Drawing.Color.FromArgb(c.R, c.G, c.B);
 }