Working with Highlight Effect for Text Portions in PowerPoint Presentations in Java

Hi!

I have an issue when working with the highlight effect of the contents of the Portion object (Aspose Slides for Java v21.10).

When I access a certain Portion object, in order to read the RGBA values of the color used for the highlight, I access its property of type IPortionFormatEffectiveData (using the method call portion.getPortionFormat().getEffective()) from which I read the highlight color by obtaining the Color object by calling the method portionFormatEffectiveData.getHighlightColor(), and from which I read in order the values ​​for red, green, blue and alpha by using their getters.

What I haven’t found a way is to set the same values (RGBA values for Potion’s highlight).

If there is a provided way, can you give me a suggestion on how I can do it?

Best regards!
Nenad

@zpredojevic,

You can use the following way to highlight a portion:

portion.getPortionFormat().getHighlightColor().setColor (Color.YELLOW); 

This documentation page contains more examples of how to highlight text.

@victor.krivolap

Thank you. I see. I really don’t understand how I missed such a simple solution.

Thanks again!

Best regards!
Nenad