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 2013/03/13 16:53:27 UTC

[Bug 54689] New: tint value is wrongly applied for several colors

https://issues.apache.org/bugzilla/show_bug.cgi?id=54689

            Bug ID: 54689
           Summary: tint value is wrongly applied for several colors
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: sven.engelhardt@ipsways.com
    Classification: Unclassified

For e.g. xlsx cell back ground color 14277081 - rgb 252/213/180 (visual basic 
used: ActiveCell.Interior.Color) the tint value is correct and also getRgb() 
delivers the correct value (byte array: [-9, -106, 70] - theme 9) without tint 
applied. But the value with the tint applied by getRgbWithTint() (XSSFColor 
internal private method applyTint()) delivers rgb 251/212/180 (byte array: 
[-5, -44, -76] - Hex: F79646). Other color value to reproduce is 14277081 
(theme - 0).

-- 
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


[Bug 54689] tint value is wrongly applied for several colors

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

Sven <sv...@ipsways.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Sven <sv...@ipsways.com> ---
Sorry, I mixed up some colors. Here's the corrected text: 

For e.g. xlsx cell back ground color 11851260 - rgb 252/213/180 (visual basic 
used: ActiveCell.Interior.Color) the tint value is correct and also getRgb() 
delivers the correct value (byte array: [-9, -106, 70] - Hex: F79646 - theme 9) 
without tint applied. But the value with the tint applied by getRgbWithTint() 
(XSSFColor internal private method applyTint()) delivers rgb 251/212/180 (byte 
array: [-5, -44, -76]). 

Other color value to reproduce () is 14277081 - rgb 217/217/217 (theme - 0). 
getRgb() delivers the correct value (byte array: [-1, -1, -1]) but
getRgbWithTint() 
delivers byte array [0, 0, 0] even if the tint is -0.1499984740745262. 
If I apply the tint using your method from 3.9 manually I even receive 
216/216/216.

    private static byte applyTint(int lum, double tint){
        if(tint > 0){
            return (byte)(lum * (1.0-tint) + (255 - 255 * (1.0-tint)));
        } else if (tint < 0){
            return (byte)(lum*(1+tint));
        } else {
            return (byte)lum;
        }
    }

-- 
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


[Bug 54689] tint value is wrongly applied for several colors

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

--- Comment #2 from Sven <sv...@ipsways.com> ---
Additionally for the second case I see XSSFColor.getRgb() delivers byte array 
[-1, -1, -1] where XSSFColor.getCTColor().getRgb() delivers [0, 0, 0]. This 
is the reason why getRgbWithTint() delivers [0, 0, 0] also. I applied tint with 
XSSFColor.getRgb().

-- 
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