We have attached a file “icons.pptx” containing 2 icons of different colors.
We have extracted the svg content for both of these files using below code snippet and attached the svg content files as “svg_content_1.txt” and “svg_content_2.txt”
Now when we examine and make changes to these svg_content, we have made below observation:
The color of these svg icons in the ppt are mainly controlled by the style class names i.e MsftOfcThm_Accent2_lumMod_100_Fill_v2 and MsftOfcThm_Accent1_lumMod_40_lumOff_60_Fill_v2, irrespective of whatever color code is mentioned in fill property.
Is our observation correct ? If yes, is there any rulebook about these class names that we can refer to while writing these style classes ? If not how can we get more detail on this ?
If we replace the keyword “Accent2” with “Accent4” in svg_content_1.txt and replace this new svg image on shape[0]. Then the new replaced image reflects Accent4 color. If we have to make an RGB color reflect in place of Accent color then how do we achieve that ?
Yes, your observation is correct. The color of SVG icons in PowerPoint can be influenced by style class names like MsftOfcThm_Accent2_lumMod_100_Fill_v2. These class names are part of the theme colors used in Microsoft Office applications. Unfortunately, there isn’t a comprehensive guide available for these class names, as they are generated internally by PowerPoint.
To replace an accent color with a specific RGB color in your SVG content, you can directly modify the fill property in the SVG code. For example, if you want to set a specific RGB color, you can replace the fill property like this:
<path fill="rgb(255,0,0)" d="..."/>
This modification will ensure that the icon reflects the specified RGB color instead of the accent color.
For further information on working with SVG in PowerPoint, please consult the official Microsoft documentation on themes and colors.
@Prezent,
Thank you for posting the questions. Unfortunately, Aspose.Slides does not provide an API to manage SVG images. I’ve moved this thread to Aspose.Total forum. My colleagues from Aspose.Imaging team will assist you shortly.
@Prezent ,
Unfortunately, it’s currently not possible to edit SVG images using Aspose.Imaging.
Using the Aspose.Imaging API, you can open/create a new image/append to an existing one/save it.
Hi Stanislav,
Thank you for your reply.
our queries were not about using aspose.Imaging APIs, however, in general about SVGs. Can you please point us in a direction or reroute this ticket to someone who can help us with our queries ?