fix RawColor4 value range

This commit is contained in:
Luis Reich
2026-09-24 23:35:54 +02:00
parent e6a10b9f72
commit 9c93e47695

View File

@@ -194,7 +194,8 @@ namespace Overlay.NET.Directx {
/// </returns> /// </returns>
public int CreateBrush(int color) { public int CreateBrush(int color) {
_brushContainer.Add(new SolidColorBrush(_device, _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; return _brushContainer.Count - 1;
} }
@@ -210,7 +211,7 @@ namespace Overlay.NET.Directx {
color = Color.FromArgb(255, color); 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; return _brushContainer.Count - 1;
} }