mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 07:25:28 +00:00
Color4(byte, byte, byte, byte) constructor now correctly normalizes values to the 0.0 - 1.0 range.
This commit is contained in:
parent
6ed8474797
commit
e9d7d147d8
|
@ -82,16 +82,16 @@ namespace OpenTK.Graphics
|
|||
/// <summary>
|
||||
/// Constructs a new Color4 structure from the specified components.
|
||||
/// </summary>
|
||||
/// <param name="r"></param>
|
||||
/// <param name="g"></param>
|
||||
/// <param name="b"></param>
|
||||
/// <param name="a"></param>
|
||||
/// <param name="r">The red component of the new Color4 structure.</param>
|
||||
/// <param name="g">The green component of the new Color4 structure.</param>
|
||||
/// <param name="b">The blue component of the new Color4 structure.</param>
|
||||
/// <param name="a">The alpha component of the new Color4 structure.</param>
|
||||
public Color4(byte r, byte g, byte b, byte a)
|
||||
{
|
||||
R = r * (float)Byte.MaxValue;
|
||||
G = g * (float)Byte.MaxValue;
|
||||
B = b * (float)Byte.MaxValue;
|
||||
A = a * (float)Byte.MaxValue;
|
||||
R = r / (float)Byte.MaxValue;
|
||||
G = g / (float)Byte.MaxValue;
|
||||
B = b / (float)Byte.MaxValue;
|
||||
A = a / (float)Byte.MaxValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in a new issue