mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Devices - Added custom layout loading
This commit is contained in:
1 parent
056b2bface
commit
b154badd9c
21 files changed
+414
-110
No files matched your search
@@ -286,7 +286,7 @@ namespace Artemis.UI.Shared
|
||||
InvalidateMeasure();
|
||||
}
|
||||
|
||||
private void DeviceUpdated(object sender, EventArgs e)
|
||||
private void DeviceUpdated(object? sender, EventArgs e)
|
||||
{
|
||||
SetupForDevice();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Artemis.UI.Shared
|
||||
internal class DeviceVisualizerLed
|
||||
{
|
||||
private SolidColorBrush? _renderColorBrush;
|
||||
private Color _renderColor;
|
||||
|
||||
public DeviceVisualizerLed(ArtemisLed led)
|
||||
{
|
||||
@@ -40,13 +41,18 @@ namespace Artemis.UI.Shared
|
||||
if (DisplayGeometry == null)
|
||||
return;
|
||||
|
||||
_renderColorBrush ??= new SolidColorBrush();
|
||||
|
||||
RGB.NET.Core.Color originalColor = Led.GetOriginalColor();
|
||||
byte r = originalColor.GetR();
|
||||
byte g = originalColor.GetG();
|
||||
byte b = originalColor.GetB();
|
||||
|
||||
_renderColorBrush ??= new SolidColorBrush();
|
||||
_renderColorBrush.Color = isDimmed ? Color.FromArgb(100, r, g, b) : Color.FromRgb(r, g, b);
|
||||
_renderColor.A = isDimmed ? 100 : 255;
|
||||
_renderColor.R = r;
|
||||
_renderColor.G = g;
|
||||
_renderColor.B = b;
|
||||
_renderColorBrush.Color = _renderColor;
|
||||
drawingContext.DrawRectangle(_renderColorBrush, null, LedRect);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user