DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=38921>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38921 ------- Additional Comments From [EMAIL PROTECTED] 2006-03-22 11:31 ------- That resolution wouldn't work properly, as long as distance isn't being calculated properly: If the desired color is 254,0,0: - The color 0,254,0 will have colorDistance==0, but colors are really different. - The color 255,0,0, although is really similar (colorDistance==1), won't be chosen because there is another color (the previous one) with less colorDistance. In my opinion, a better way for calculating the colorDistance would be: int colorDistance = Math.abs(r - comp[0]) + Math.abs(g - comp[1]) + Math.abs(b - comp[2]) Once the colorDistance is calculated properly, a breaking condition can be added before the comparision (colorDistance < minColorDistance) when the exact color is found: if (colorDistance==0) { return getColor(i); } -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta POI Project: http://jakarta.apache.org/poi/