Hi,
I have to set a RGB-Value for the background-color of a cell. Here is a code-sample:
Cell c = new Cell(r, “test”);
BigDecimal bg = new BigDecimal(170);
c.setBackGroundColor(new Color(bg.byteValue(),bg.byteValue(),bg.byteValue()));
When I try to add this cell and safe my document I get a exception:
java.lang.IllegalArgumentException: Color parameter outside of expected range: Red Green Blue
The reason is that byte only goes from -128 to +127. I expected that you take this range to get 255 colors. But I can´t give you a negative value. Then I get a exception. How can I set my RBG [170, 168, 168] color and any other RGB color for the cell, so that it is working? Thanks. (we have a license with support)
Hello Marcel,
I've tested the scenario and I am able to notice the same problem. Please spare us little time as we are looking into the details of this problem and will keep you updated with the status of correction. We apologize for your inconvenience.
Hello Marcel,
We also provide RgbColorSpace in our product. Maybe it is a good idea to use this method instead. So your code would look like this:
Cell c = new Cell(r, "test");
c.setBackgroundColor(new RgbColorSpace((short)170,(short)168,(short)168));
Thank you for using our product.
Thanks. This Object works.