[Mono-bugs] [Bug 74868][Nor] Changed - [PATCH] Color.GetBrightness and GetSaturation return wrong values

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 9 May 2005 17:06:38 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by juraj@hotfeet.ch.

http://bugzilla.ximian.com/show_bug.cgi?id=74868

--- shadow/74868	2005-05-09 16:52:37.000000000 -0400
+++ shadow/74868.tmp.8360	2005-05-09 17:06:38.000000000 -0400
@@ -41,6 +41,15 @@
 ------- Additional Comments From peter@novonyx.com  2005-05-09 16:52 -------
 Thanks for the patch. Works great, but I don't like the separate 
 class (and file) that's been introduced for this. If you insist on 
 the separate class, could you please move it into the Color.cs file 
 as a subclass, or, better, move the math into each function like the 
 code you are replacing had it originally?
+
+------- Additional Comments From juraj@hotfeet.ch  2005-05-09 17:06 -------
+Using a separate class has the advantage of keeping the Color struct
+light memory-wise. If I'm not mistaken, structs are put on the stack
+when they're passed to a method. This way we extend Color only by one
+reference, but still have cached results for H, B and S for those
+Color objects where they're needed.
+
+I'll attach the subclass-version in a minute...