Author: juraj
Date: 2005-05-10 16:29:38 -0400 (Tue, 10 May 2005)
New Revision: 44350
Modified:
trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
trunk/mcs/class/System.Drawing/System.Drawing/Color.cs
Log:
2005-05-10 Juraj Skripsky <[EMAIL PROTECTED]>
* Color.cs: Fix GetSaturation() again and remove
obsolete constants.
Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog 2005-05-10
20:28:40 UTC (rev 44349)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog 2005-05-10
20:29:38 UTC (rev 44350)
@@ -1,8 +1,13 @@
2005-05-10 Juraj Skripsky <[EMAIL PROTECTED]>
- * TestColor.cs: Added tests for GetHue, GetBrightness
- and GetSaturation.
+ * Color.cs: Fix GetSaturation() again and remove
+ obsolete constants.
+2005-05-10 Juraj Skripsky <[EMAIL PROTECTED]>
+
+ * Color.cs: New, correct implementations for GetHue(),
+ GetBrightness() and GetSaturation().
+
2005-05-09 Sebastien Pouliot <[EMAIL PROTECTED]>
* gdipFunctions.cs: Use PlatformID.Unix under NET_2_0.
Modified: trunk/mcs/class/System.Drawing/System.Drawing/Color.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Color.cs 2005-05-10
20:28:40 UTC (rev 44349)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Color.cs 2005-05-10
20:29:38 UTC (rev 44350)
@@ -50,8 +50,6 @@
[Serializable]
public struct Color
{
- private const float RGBMax = 255;
- private const float HLSMax = 240;
private static Hashtable namedColors;
private static Hashtable systemColors;
static Color [] knownColors;
@@ -307,6 +305,9 @@
byte minval = Math.Min (r, Math.Min (g, b));
byte maxval = Math.Max (r, Math.Max (g, b));
+ if (maxval == minval)
+ return 0.0f;
+
int sum = maxval + minval;
if (sum > 255)
sum = 510 - sum;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches