lolp1 / Overlay.NET

An easy-to-use overlay library written in C# by Jacob Kemple.
732 stars 87 forks source link

maybe nevertheless a color-bug? #26

Open mbastiek opened 5 years ago

mbastiek commented 5 years ago

Hi! Related to https://github.com/lolp1/Overlay.NET/issues/20

I had to change in Direct2DRenderer.cs public int CreateBrush from new RawColor4((color >> 16) & 255L, (color >> 8) & 255L, (byte) color & 255L, (color >> 24) & 255L))); to new RawColor4(((color >> 16) & 255L ) / 255.0f, ((color >> 8) & 255L) / 255.0f, ( color & 255L) / 255.0f, ((color >> 24) & 255L) / 255.0f)));

and

_brushContainer.Add(new SolidColorBrush(_device, new RawColor4(color.R, color.G, color.B, color.A / 255.0f))); to _brushContainer.Add(new SolidColorBrush(_device, new RawColor4(color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f)));

to make it work to my understanding of int-colors and Color-colors. But my understanding is not that strong in this case.

The alpha-channel inversion and the single case change from 0 to 255 ist still to think about. Edit: removed the single case change from 0 to 255.

Thanks for the good work though.

Greetings