fix RawColor4 value range
This commit is contained in:
@@ -194,7 +194,8 @@ namespace Overlay.NET.Directx {
|
||||
/// </returns>
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user