You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
844 B
35 lines
844 B
5 years ago
|
using Colore;
|
||
|
using Colore.Data;
|
||
|
using Colore.Effects.Keyboard;
|
||
|
using System;
|
||
|
|
||
|
namespace ChromaController
|
||
|
{
|
||
|
internal class EffectRegion
|
||
|
{
|
||
|
public Key[] Keys { get; private set; }
|
||
|
public Color Color { get; private set; }
|
||
|
|
||
|
public EffectRegion(Key[] keys, Color color)
|
||
|
{
|
||
|
Keys = keys;
|
||
|
Color = color;
|
||
|
}
|
||
|
|
||
|
public EffectRegion(Key keys, Color color)
|
||
|
{
|
||
|
Keys = new Key[] { keys };
|
||
|
Color = color;
|
||
|
}
|
||
|
|
||
|
internal void Show(IChroma chroma)
|
||
|
{
|
||
|
Array.ForEach(Keys, x => chroma.Keyboard.SetKeyAsync(x, Color, false));
|
||
|
}
|
||
|
|
||
|
internal void AddToGrid(KeyboardCustom keyboardGrid)
|
||
|
{
|
||
|
Array.ForEach(Keys, x => keyboardGrid[x] = Color);
|
||
|
}
|
||
|
}
|
||
|
}
|