You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/03/24 03:07:36 UTC

DO NOT REPLY [Bug 44664] New: poi does not find Similar Color

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: dev@poi.apache.org
        ReportedBy: ta-seok@brainsellers.com


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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 44664] poi does not find Similar Color

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44664


Nick Burch <ni...@torchbox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




--- Comment #1 from Nick Burch <ni...@torchbox.com>  2008-03-24 10:14:22 PST ---
I believe this was fixed after bug #38921

Have you tried with svn trunk

*** This bug has been marked as a duplicate of bug 38921 ***


-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org