Hi,
Please use this code instead, it will return the correct color of the 4th character, which is black, so red part is 0.
I have highlighted the changes in red.
The output of this code will be 0, which is correct.
Java
String path = "F:\\Shak-Data-RW\\Downloads\\formatting-test.xls";
Workbook workbook = new Workbook(path);
Worksheet worksheet = workbook.getWorksheets().get(0);
Cell cell = worksheet.getCells().get(0);
FontSetting[] characters = cell.getCharacters();
FontSetting fontSetting = cell.characters(4, 1);
Color color = fontSetting.getFont().getColor();
int red = color.getR();
System.out.println(red);
Many Thanks and Kind Regards,
Shakeel Faiz
Support Developer
Aspose Sialkot Team
Contact UsAspose - The .NET and Java Component Publisher
Keep in touch! We're on
Twitter and
Facebook