mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-11 04:56:44 +00:00
Added basic CUE-Profile loading
This commit is contained in:
1 parent
074f823fd7
commit
0b6ba617ac
7 files changed
+406
No files matched your search
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using CUE.NET.Devices.Keyboard.Enums;
|
||||
using CUE.NET.Devices.Keyboard.Keys;
|
||||
|
||||
namespace CUE.NET.Brushes
|
||||
{
|
||||
public class ProfileBrush : AbstractBrush
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private Dictionary<CorsairKeyboardKeyId, Color> _keyLights;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal ProfileBrush(Dictionary<CorsairKeyboardKeyId, Color> keyLights)
|
||||
{
|
||||
this._keyLights = keyLights;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public override Color GetColorAtPoint(RectangleF rectangle, PointF point)
|
||||
{
|
||||
CorsairKey key = CueSDK.KeyboardSDK[point];
|
||||
if (key == null) return Color.Transparent;
|
||||
|
||||
Color color;
|
||||
if (!_keyLights.TryGetValue(key.KeyId, out color))
|
||||
return Color.Transparent;
|
||||
|
||||
return FinalizeColor(color);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user