Color4(byte, byte, byte, byte) constructor now correctly normalizes values to the 0.0 - 1.0 range.

This commit is contained in:
the_fiddler 2009-11-10 00:09:04 +00:00
parent 6ed8474797
commit e9d7d147d8

View file

@ -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>