How to set multiple colors to the content in a cell

Hello,
Need assistance in setting different colors to the content in a cell with Aspose Cells Java API.
For example,
Cell cell = cells.get(“A1”);
cell.setValue(“Hello Aspose”);
How do I set the red color to hello and the blue color to Aspose content separately?

Thanks in Advance

@SrideviG you can use the following code to complete your own, additionally you can check the following link for further information:

Font font = cell.characters(1, 5).getFont();

// Setting the font color of selected characters to blue
font.setColor(Color.getBlue());

font = cell.characters(6, 6).getFont();

// Setting the font color of selected characters to red
font.setColor(Color.getRed());

This helps.

Thanks for quick response.

1 Like

@SrideviG,
I’m glad your issue has been solved. If you have any questions, please feel free to contact us.