From 9c93e47695a2edb922e317336ce7e223678c7ae1 Mon Sep 17 00:00:00 2001 From: Luis Reich Date: Thu, 24 Sep 2026 23:35:54 +0200 Subject: [PATCH] fix RawColor4 value range --- src/Overlay.NET/Directx/Direct2DRenderer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Overlay.NET/Directx/Direct2DRenderer.cs b/src/Overlay.NET/Directx/Direct2DRenderer.cs index 8f73826..156b9c2 100644 --- a/src/Overlay.NET/Directx/Direct2DRenderer.cs +++ b/src/Overlay.NET/Directx/Direct2DRenderer.cs @@ -194,7 +194,8 @@ namespace Overlay.NET.Directx { /// public int CreateBrush(int color) { _brushContainer.Add(new SolidColorBrush(_device, - new RawColor4((color >> 16) & 255L, (color >> 8) & 255L, (byte) color & 255L, (color >> 24) & 255L))); + new RawColor4(((color >> 16) & 255) / 255f, ((color >> 8) & 255) / 255f, (color & 255) / 255f, + ((color >> 24) & 255) / 255f))); return _brushContainer.Count - 1; } @@ -210,7 +211,7 @@ namespace Overlay.NET.Directx { color = Color.FromArgb(255, color); } - _brushContainer.Add(new SolidColorBrush(_device, new RawColor4(color.R, color.G, color.B, color.A / 255.0f))); + _brushContainer.Add(new SolidColorBrush(_device, new RawColor4(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f))); return _brushContainer.Count - 1; }