From e9d7d147d845df425454d5c2db85119f8019c50c Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 10 Nov 2009 00:09:04 +0000 Subject: [PATCH] Color4(byte, byte, byte, byte) constructor now correctly normalizes values to the 0.0 - 1.0 range. --- Source/OpenTK/Graphics/Color4.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/OpenTK/Graphics/Color4.cs b/Source/OpenTK/Graphics/Color4.cs index 7534a381..0a23c57c 100644 --- a/Source/OpenTK/Graphics/Color4.cs +++ b/Source/OpenTK/Graphics/Color4.cs @@ -82,16 +82,16 @@ namespace OpenTK.Graphics /// /// Constructs a new Color4 structure from the specified components. /// - /// - /// - /// - /// + /// The red component of the new Color4 structure. + /// The green component of the new Color4 structure. + /// The blue component of the new Color4 structure. + /// The alpha component of the new Color4 structure. 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; } ///