I am trying to freeze the shape color in google slide. So, if the user changes the theme, the shape color should not change. I understand google sheet support Theme and RGB type. I am using below snippet to fix the RGB color.
if (pageElements[j].getPageElementType() == "SHAPE") {
var fill = pageElements[j].asShape().getFill().getSolidFill().getColor();
var colorType = fill.getColorType();
Logger.log(colorType)
if (colorType == "RGB") {
shapeColor = fill.asRgbColor().asHexString();
Logger.log(shapeColor)
pageElements[j].asShape().getFill().setSolidFill(shapeColor)
}
else if (colorType == "THEME") {
shapeColor = fill.asThemeColor().getThemeColorType();
Logger.log(shapeColor)
pageElements[j].asShape().getFill().setSolidFill(shapeColor)
}
}
Is there a way we can set/fix the theme color of the shape Google Slide Documentation