https://issues.apache.org/bugzilla/show_bug.cgi?id=44664
Summary: poi does not find Similar Color
Product: POI
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: major
Priority: P2
Component: HSSF
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
Hi
I found some problem at the method
HSSFPalette.findSimilarColor(byte red, byte green, byte blue)
This does not return similar color.
When I input Color A I get the Color B from this method.
Color A -> red:120 green:114 blue:4
Color B -> red:51 green:51 blue:51 ColorIndex:63
But this is not proper color value.
When I use this edited method I can get the proper color value.
public HSSFColor findSimilarColor(byte red, byte green, byte blue)
{
.
.
.
//int colorDistance = red - b[0] + green - b[1] + blue - b[2];
int colorDistance = Math.abs(((int) red & 0xff) - ((int) b[0] & 0xff))
+ Math.abs(((int) green & 0xff) - ((int) b[1] & 0xff))
+ Math.abs(((int) blue & 0xff) - ((int) b[2] & 0xff));
.
.
.
}
Color A -> red:120 green:114 blue:4
Color B -> red:-128 green:-128 blue:0 ColorIndex:19
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]