import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
+import org.openxmlformats.schemas.drawingml.x2006.main.CTColor;
import org.openxmlformats.schemas.drawingml.x2006.main.CTColorScheme;
import org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument;
-import org.openxmlformats.schemas.drawingml.x2006.main.CTColor;
/**
* Class that represents theme of XLSX document. The theme includes specific
* colors and fonts.
- *
- * @author Petr Udalau(Petr.Udalau at exigenservices.com) - theme colors
*/
public class ThemesTable extends POIXMLDocumentPart {
private ThemeDocument theme;
+ /**
+ * Construct a ThemesTable.
+ * @param part A PackagePart.
+ * @param rel A PackageRelationship.
+ */
public ThemesTable(PackagePart part, PackageRelationship rel) throws IOException {
super(part, rel);
}
}
+ /**
+ * Construct a ThemesTable from an existing ThemeDocument.
+ * @param theme A ThemeDocument.
+ */
public ThemesTable(ThemeDocument theme) {
this.theme = theme;
}
+ /**
+ * Convert a theme "index" into a color.
+ * @param idx A theme "index"
+ * @return The mapped XSSFColor, or null if not mapped.
+ */
public XSSFColor getThemeColor(int idx) {
+ // Theme color references are NOT positional indices into the color scheme,
+ // i.e. these keys are NOT the same as the order in which theme colors appear
+ // in theme1.xml. They are keys to a mapped color.
CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme();
- CTColor ctColor = null;
- int cnt = 0;
- for (XmlObject obj : colorScheme.selectPath("./*")) {
- if (obj instanceof org.openxmlformats.schemas.drawingml.x2006.main.CTColor) {
- if (cnt == idx) {
- ctColor = (org.openxmlformats.schemas.drawingml.x2006.main.CTColor) obj;
-
- byte[] rgb = null;
- if (ctColor.getSrgbClr() != null) {
- // Colour is a regular one
- rgb = ctColor.getSrgbClr().getVal();
- } else if (ctColor.getSysClr() != null) {
- // Colour is a tint of white or black
- rgb = ctColor.getSysClr().getLastClr();
- }
+ CTColor ctColor;
+ switch (idx) {
+ case 0: ctColor = colorScheme.getLt1(); break;
+ case 1: ctColor = colorScheme.getDk1(); break;
+ case 2: ctColor = colorScheme.getLt2(); break;
+ case 3: ctColor = colorScheme.getDk2(); break;
+ case 4: ctColor = colorScheme.getAccent1(); break;
+ case 5: ctColor = colorScheme.getAccent2(); break;
+ case 6: ctColor = colorScheme.getAccent3(); break;
+ case 7: ctColor = colorScheme.getAccent4(); break;
+ case 8: ctColor = colorScheme.getAccent5(); break;
+ case 9: ctColor = colorScheme.getAccent6(); break;
+ case 10: ctColor = colorScheme.getHlink(); break;
+ case 11: ctColor = colorScheme.getFolHlink(); break;
+ default: return null;
+ }
- return new XSSFColor(rgb);
- }
- cnt++;
- }
+ byte[] rgb = null;
+ if (ctColor.isSetSrgbClr()) {
+ // Color is a regular one
+ rgb = ctColor.getSrgbClr().getVal();
+ } else if (ctColor.isSetSysClr()) {
+ // Color is a tint of white or black
+ rgb = ctColor.getSysClr().getLastClr();
+ } else {
+ return null;
}
- return null;
+ return new XSSFColor(rgb);
}
/**
- * If the colour is based on a theme, then inherit
+ * If the colour is based on a theme, then inherit
* information (currently just colours) from it as
* required.
*/
// No theme set, nothing to do
return;
}
-
+
// Get the theme colour
XSSFColor themeColor = getThemeColor(color.getTheme());
// Set the raw colour, not the adjusted one
// Do a raw set, no adjusting at the XSSFColor layer either
color.getCTColor().setRgb(themeColor.getCTColor().getRgb());
-
+
// All done
}
}
* Represents a color in SpreadsheetML
*/
public class XSSFColor implements Color {
-
- private CTColor ctColor;
+
+ private CTColor ctColor;
/**
* Create an instance of XSSFColor from the supplied XML bean
*/
public XSSFColor(CTColor color) {
- this.ctColor = color;
- }
-
+ this.ctColor = color;
+ }
+
/**
* Create an new instance of XSSFColor
*/
* A boolean value indicating the ctColor is automatic and system ctColor dependent.
*/
public boolean isAuto() {
- return ctColor.getAuto();
- }
-
+ return ctColor.getAuto();
+ }
+
/**
* A boolean value indicating the ctColor is automatic and system ctColor dependent.
*/
- public void setAuto(boolean auto) {
- ctColor.setAuto(auto);
- }
+ public void setAuto(boolean auto) {
+ ctColor.setAuto(auto);
+ }
/**
* Indexed ctColor value. Only used for backwards compatibility. References a ctColor in indexedColors.
*/
public short getIndexed() {
- return (short)ctColor.getIndexed();
- }
-
+ return (short)ctColor.getIndexed();
+ }
+
/**
* Indexed ctColor value. Only used for backwards compatibility. References a ctColor in indexedColors.
*/
- public void setIndexed(int indexed) {
- ctColor.setIndexed(indexed);
- }
-
- /**
- * For RGB colours, but not ARGB (we think...)
- * Excel gets black and white the wrong way around, so switch them
- */
- private byte[] correctRGB(byte[] rgb) {
- if(rgb.length == 4) {
- // Excel doesn't appear to get these wrong
- // Nothing to change
- return rgb;
- } else {
- // Excel gets black and white the wrong way around, so switch them
- if (rgb[0] == 0 && rgb[1] == 0 && rgb[2] == 0) {
- rgb = new byte[] {-1, -1, -1};
- }
- else if (rgb[0] == -1 && rgb[1] == -1 && rgb[2] == -1) {
- rgb = new byte[] {0, 0, 0};
- }
- return rgb;
- }
- }
+ public void setIndexed(int indexed) {
+ ctColor.setIndexed(indexed);
+ }
/**
* Standard Red Green Blue ctColor value (RGB).
public byte[] getRgb() {
byte[] rgb = getRGBOrARGB();
if(rgb == null) return null;
-
+
if(rgb.length == 4) {
// Need to trim off the alpha
byte[] tmp = new byte[3];
public byte[] getARgb() {
byte[] rgb = getRGBOrARGB();
if(rgb == null) return null;
-
+
if(rgb.length == 3) {
// Pad with the default Alpha
byte[] tmp = new byte[4];
return rgb;
}
}
-
+
private byte[] getRGBOrARGB() {
byte[] rgb = null;
return rgb;
}
}
-
+
if (!ctColor.isSetRgb()) {
// No colour is available, sorry
return null;
// Grab the colour
rgb = ctColor.getRgb();
-
- // Correct it as needed, and return
- return correctRGB(rgb);
+ return rgb;
}
/**
}
return rgb;
}
-
+
/**
* Return the ARGB value in hex format, eg FF00FF00.
- * Works for both regular and indexed colours.
+ * Works for both regular and indexed colours.
*/
- public String getARGBHex() {
- StringBuffer sb = new StringBuffer();
- byte[] rgb = getARgb();
- if(rgb == null) {
- return null;
- }
- for(byte c : rgb) {
- int i = (int)c;
- if(i < 0) {
- i += 256;
- }
- String cs = Integer.toHexString(i);
- if(cs.length() == 1) {
- sb.append('0');
- }
- sb.append(cs);
- }
- return sb.toString().toUpperCase();
- }
-
- 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;
- }
- }
+ public String getARGBHex() {
+ StringBuffer sb = new StringBuffer();
+ byte[] rgb = getARgb();
+ if(rgb == null) {
+ return null;
+ }
+ for(byte c : rgb) {
+ int i = (int)c;
+ if(i < 0) {
+ i += 256;
+ }
+ String cs = Integer.toHexString(i);
+ if(cs.length() == 1) {
+ sb.append('0');
+ }
+ sb.append(cs);
+ }
+ return sb.toString().toUpperCase();
+ }
+
+ 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;
+ }
+ }
/**
* Standard Alpha Red Green Blue ctColor value (ARGB).
*/
- public void setRgb(byte[] rgb) {
- // Correct it and save
- ctColor.setRgb(correctRGB(rgb));
- }
-
+ public void setRgb(byte[] rgb) {
+ ctColor.setRgb(rgb);
+ }
+
/**
* Index into the <clrScheme> collection, referencing a particular <sysClr> or
* <srgbClr> value expressed in the Theme part.
*/
public int getTheme() {
return (int)ctColor.getTheme();
- }
-
+ }
+
/**
* Index into the <clrScheme> collection, referencing a particular <sysClr> or
* <srgbClr> value expressed in the Theme part.
*/
- public void setTheme(int theme) {
- ctColor.setTheme(theme);
- }
+ public void setTheme(int theme) {
+ ctColor.setTheme(theme);
+ }
/**
* Specifies the tint value applied to the ctColor.
* @return the tint value
*/
public double getTint() {
- return ctColor.getTint();
- }
-
+ return ctColor.getTint();
+ }
+
/**
* Specifies the tint value applied to the ctColor.
*
*
* @param tint the tint value
*/
- public void setTint(double tint) {
- ctColor.setTint(tint);
- }
+ public void setTint(double tint) {
+ ctColor.setTint(tint);
+ }
/**
* Returns the underlying XML bean
public CTColor getCTColor(){
return ctColor;
}
-
+
public int hashCode(){
return ctColor.toString().hashCode();
}
--- /dev/null
+/* ====================================================================\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+==================================================================== */\r
+\r
+package org.apache.poi.xssf.model;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+\r
+import java.io.FileOutputStream;\r
+\r
+import org.apache.commons.codec.binary.Hex;\r
+import org.apache.poi.ss.usermodel.CellStyle;\r
+import org.apache.poi.ss.usermodel.Row;\r
+import org.apache.poi.xssf.XSSFTestDataSamples;\r
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;\r
+import org.apache.poi.xssf.usermodel.XSSFColor;\r
+import org.apache.poi.xssf.usermodel.XSSFFont;\r
+import org.apache.poi.xssf.usermodel.XSSFRow;\r
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;\r
+import org.junit.Test;\r
+\r
+public class TestThemesTable {\r
+ private String testFile = "Themes.xlsx";\r
+\r
+ @Test\r
+ public void testThemesTableColors() throws Exception {\r
+ XSSFWorkbook workbook = XSSFTestDataSamples.openSampleWorkbook(testFile);\r
+ String rgbExpected[] = {\r
+ "ffffff", // Lt1\r
+ "000000", // Dk1\r
+ "eeece1", // Lt2\r
+ "1f497d", // DK2\r
+ "4f81bd", // Accent1\r
+ "c0504d", // Accent2\r
+ "9bbb59", // Accent3\r
+ "8064a2", // Accent4\r
+ "4bacc6", // Accent5\r
+ "f79646", // Accent6\r
+ "0000ff", // Hlink\r
+ "800080" // FolHlink\r
+ };\r
+ boolean createFile = false;\r
+ int i=0;\r
+ for (Row row : workbook.getSheetAt(0)) {\r
+ XSSFFont font = ((XSSFRow)row).getCell(0).getCellStyle().getFont();\r
+ XSSFColor color = font.getXSSFColor();\r
+ assertEquals("Failed color theme "+i, rgbExpected[i], Hex.encodeHexString(color.getRgb()));\r
+ long themeIdx = font.getCTFont().getColorArray(0).getTheme();\r
+ assertEquals("Failed color theme "+i, i, themeIdx);\r
+ if (createFile) {\r
+ XSSFCellStyle cs = (XSSFCellStyle)row.getSheet().getWorkbook().createCellStyle();\r
+ cs.setFillForegroundColor(color);\r
+ cs.setFillPattern(CellStyle.SOLID_FOREGROUND);\r
+ row.createCell(1).setCellStyle(cs);\r
+ }\r
+ i++;\r
+ }\r
+ \r
+ if (createFile) {\r
+ FileOutputStream fos = new FileOutputStream("foobaa.xlsx");\r
+ workbook.write(fos);\r
+ fos.close();\r
+ }\r
+ }\r
+}
\ No newline at end of file
public final class TestXSSFColor extends TestCase {
public void testIndexedColour() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48779.xlsx");
-
+
// Check the CTColor is as expected
XSSFColor indexed = wb.getCellStyleAt((short)1).getFillBackgroundXSSFColor();
assertEquals(true, indexed.getCTColor().isSetIndexed());
assertEquals(64, indexed.getCTColor().getIndexed());
assertEquals(false, indexed.getCTColor().isSetRgb());
assertEquals(null, indexed.getCTColor().getRgb());
-
+
// Now check the XSSFColor
// Note - 64 is a special "auto" one with no rgb equiv
assertEquals(64, indexed.getIndexed());
assertEquals(null, indexed.getRgb());
assertEquals(null, indexed.getRgbWithTint());
assertEquals(null, indexed.getARGBHex());
-
+
// Now move to one with indexed rgb values
indexed.setIndexed(59);
assertEquals(true, indexed.getCTColor().isSetIndexed());
assertEquals(59, indexed.getCTColor().getIndexed());
assertEquals(false, indexed.getCTColor().isSetRgb());
assertEquals(null, indexed.getCTColor().getRgb());
-
+
assertEquals(59, indexed.getIndexed());
assertEquals("FF333300", indexed.getARGBHex());
-
+
assertEquals(3, indexed.getRgb().length);
assertEquals(0x33, indexed.getRgb()[0]);
assertEquals(0x33, indexed.getRgb()[1]);
assertEquals(0x00, indexed.getRgb()[2]);
-
+
assertEquals(4, indexed.getARgb().length);
assertEquals(-1, indexed.getARgb()[0]);
assertEquals(0x33, indexed.getARgb()[1]);
assertEquals(0x33, indexed.getARgb()[2]);
assertEquals(0x00, indexed.getARgb()[3]);
-
+
// You don't get tinted indexed colours, sorry...
assertEquals(null, indexed.getRgbWithTint());
}
-
+
public void testRGBColour() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50299.xlsx");
-
+
// Check the CTColor is as expected
XSSFColor rgb3 = wb.getCellStyleAt((short)25).getFillForegroundXSSFColor();
assertEquals(false, rgb3.getCTColor().isSetIndexed());
assertEquals(-0.34999, rgb3.getCTColor().getTint(), 0.00001);
assertEquals(true, rgb3.getCTColor().isSetRgb());
assertEquals(3, rgb3.getCTColor().getRgb().length);
-
+
// Now check the XSSFColor
assertEquals(0, rgb3.getIndexed());
assertEquals(-0.34999, rgb3.getTint(), 0.00001);
-
+
assertEquals("FFFFFFFF", rgb3.getARGBHex());
assertEquals(3, rgb3.getRgb().length);
assertEquals(-1, rgb3.getRgb()[0]);
assertEquals(-1, rgb3.getRgb()[1]);
assertEquals(-1, rgb3.getRgb()[2]);
-
+
assertEquals(4, rgb3.getARgb().length);
assertEquals(-1, rgb3.getARgb()[0]);
assertEquals(-1, rgb3.getARgb()[1]);
assertEquals(-1, rgb3.getARgb()[2]);
assertEquals(-1, rgb3.getARgb()[3]);
-
+
// Tint doesn't have the alpha
+ // tint = -0.34999
+ // 255 * (1 + tint) = 165 truncated
+ // or (byte) -91 (which is 165 - 256)
assertEquals(3, rgb3.getRgbWithTint().length);
- assertEquals(0, rgb3.getRgbWithTint()[0]);
- assertEquals(0, rgb3.getRgbWithTint()[1]);
- assertEquals(0, rgb3.getRgbWithTint()[2]);
-
- // Set the colour to black, will get translated internally
- // (Excel stores 3 colour white and black wrong!)
- rgb3.setRgb(new byte[] {-1,-1,-1});
- assertEquals("FFFFFFFF", rgb3.getARGBHex());
+ assertEquals(-91, rgb3.getRgbWithTint()[0]);
+ assertEquals(-91, rgb3.getRgbWithTint()[1]);
+ assertEquals(-91, rgb3.getRgbWithTint()[2]);
+
+ // Set the color to black (no theme).
+ rgb3.setRgb(new byte[] {0, 0, 0});
+ assertEquals("FF000000", rgb3.getARGBHex());
assertEquals(0, rgb3.getCTColor().getRgb()[0]);
assertEquals(0, rgb3.getCTColor().getRgb()[1]);
assertEquals(0, rgb3.getCTColor().getRgb()[2]);
-
+
// Set another, is fine
rgb3.setRgb(new byte[] {16,17,18});
assertEquals("FF101112", rgb3.getARGBHex());
assertEquals(0x11, rgb3.getCTColor().getRgb()[1]);
assertEquals(0x12, rgb3.getCTColor().getRgb()[2]);
}
-
+
public void testARGBColour() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48779.xlsx");
-
+
// Check the CTColor is as expected
XSSFColor rgb4 = wb.getCellStyleAt((short)1).getFillForegroundXSSFColor();
assertEquals(false, rgb4.getCTColor().isSetIndexed());
assertEquals(0, rgb4.getCTColor().getIndexed());
assertEquals(true, rgb4.getCTColor().isSetRgb());
assertEquals(4, rgb4.getCTColor().getRgb().length);
-
+
// Now check the XSSFColor
assertEquals(0, rgb4.getIndexed());
assertEquals(0.0, rgb4.getTint());
-
+
assertEquals("FFFF0000", rgb4.getARGBHex());
assertEquals(3, rgb4.getRgb().length);
assertEquals(-1, rgb4.getRgb()[0]);
assertEquals(0, rgb4.getRgb()[1]);
assertEquals(0, rgb4.getRgb()[2]);
-
+
assertEquals(4, rgb4.getARgb().length);
assertEquals(-1, rgb4.getARgb()[0]);
assertEquals(-1, rgb4.getARgb()[1]);
assertEquals(0, rgb4.getARgb()[2]);
assertEquals(0, rgb4.getARgb()[3]);
-
+
// Tint doesn't have the alpha
assertEquals(3, rgb4.getRgbWithTint().length);
assertEquals(-1, rgb4.getRgbWithTint()[0]);
assertEquals(0, rgb4.getRgbWithTint()[1]);
assertEquals(0, rgb4.getRgbWithTint()[2]);
-
+
// Turn on tinting, and check it behaves
// TODO These values are suspected to be wrong...
rgb4.setTint(0.4);
assertEquals(0.4, rgb4.getTint());
-
+
assertEquals(3, rgb4.getRgbWithTint().length);
assertEquals(-1, rgb4.getRgbWithTint()[0]);
assertEquals(102, rgb4.getRgbWithTint()[1]);
public class TestXSSFCellFill extends TestCase {
-
- public void testGetFillBackgroundColor() {
- CTFill ctFill = CTFill.Factory.newInstance();
- XSSFCellFill cellFill = new XSSFCellFill(ctFill);
- CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
- CTColor bgColor = ctPatternFill.addNewBgColor();
- assertNotNull(cellFill.getFillBackgroundColor());
- bgColor.setIndexed(2);
- assertEquals(2, cellFill.getFillBackgroundColor().getIndexed());
- }
-
- public void testGetFillForegroundColor() {
- CTFill ctFill = CTFill.Factory.newInstance();
- XSSFCellFill cellFill = new XSSFCellFill(ctFill);
- CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
- CTColor fgColor = ctPatternFill.addNewFgColor();
- assertNotNull(cellFill.getFillForegroundColor());
- fgColor.setIndexed(8);
- assertEquals(8, cellFill.getFillForegroundColor().getIndexed());
- }
-
- public void testGetSetPatternType() {
- CTFill ctFill = CTFill.Factory.newInstance();
- XSSFCellFill cellFill = new XSSFCellFill(ctFill);
- CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
- ctPatternFill.setPatternType(STPatternType.SOLID);
- //assertEquals(FillPatternType.SOLID_FOREGROUND.ordinal(), cellFill.getPatternType().ordinal());
- }
+
+ public void testGetFillBackgroundColor() {
+ CTFill ctFill = CTFill.Factory.newInstance();
+ XSSFCellFill cellFill = new XSSFCellFill(ctFill);
+ CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
+ CTColor bgColor = ctPatternFill.addNewBgColor();
+ assertNotNull(cellFill.getFillBackgroundColor());
+ bgColor.setIndexed(2);
+ assertEquals(2, cellFill.getFillBackgroundColor().getIndexed());
+ }
+
+ public void testGetFillForegroundColor() {
+ CTFill ctFill = CTFill.Factory.newInstance();
+ XSSFCellFill cellFill = new XSSFCellFill(ctFill);
+ CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
+ CTColor fgColor = ctPatternFill.addNewFgColor();
+ assertNotNull(cellFill.getFillForegroundColor());
+ fgColor.setIndexed(8);
+ assertEquals(8, cellFill.getFillForegroundColor().getIndexed());
+ }
+
+ public void testGetSetPatternType() {
+ CTFill ctFill = CTFill.Factory.newInstance();
+ XSSFCellFill cellFill = new XSSFCellFill(ctFill);
+ CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
+ ctPatternFill.setPatternType(STPatternType.SOLID);
+ //assertEquals(FillPatternType.SOLID_FOREGROUND.ordinal(), cellFill.getPatternType().ordinal());
+ }
public void testGetNotModifies() {
CTFill ctFill = CTFill.Factory.newInstance();
XSSFColor foregroundColor = cellWithThemeColor.getCellStyle().getFillForegroundXSSFColor();
byte[] rgb = foregroundColor.getRgb();
byte[] rgbWithTint = foregroundColor.getRgbWithTint();
- assertEquals(rgb[0],-18);
- assertEquals(rgb[1],-20);
- assertEquals(rgb[2],-31);
- assertEquals(rgbWithTint[0],-12);
- assertEquals(rgbWithTint[1],-13);
- assertEquals(rgbWithTint[2],-20);
+ // Dk2
+ assertEquals(rgb[0],31);
+ assertEquals(rgb[1],73);
+ assertEquals(rgb[2],125);
+ // Dk2, lighter 40% (tint is about 0.39998)
+ // 31 * (1.0 - 0.39998) + (255 - 255 * (1.0 - 0.39998)) = 120.59552 => 120 (byte)
+ // 73 * (1.0 - 0.39998) + (255 - 255 * (1.0 - 0.39998)) = 145.79636 => -111 (byte)
+ // 125 * (1.0 - 0.39998) + (255 - 255 * (1.0 - 0.39998)) = 176.99740 => -80 (byte)
+ assertEquals(rgbWithTint[0],120);
+ assertEquals(rgbWithTint[1],-111);
+ assertEquals(rgbWithTint[2],-80);
}
}