I am writing a script for Google Slides using Apps Script (including Slides API) for auto-formatting presentations. Crucial function there is to recolor images using certain color.
function img() {
var i_id = SlidesApp.getActivePresentation().getSlides()[0].getImages() [0].getObjectId();
Logger.log(i_id);
var p_id = SlidesApp.getActivePresentation().getId();
var requests = [{
updateImageProperties:{
objectId: i_id,
imageProperties: {
recolor: {
recolorStops: [{
color: {
rgbColor: {
red: 0.4,
green: 0.9,
blue: 0.4
}
},
alpha: 1,
position: 0.5
}]
}
},
fields: "recolor.recolorStops(color.rgbColor(red,green,blue),alpha,position)"
}
}];
Slides.Presentations.batchUpdate({'requests': requests}, p_id)}
I have written the code and it doesn't trigger error, however image is left unchanged.
After batchupdate request, the image should have been recolored. Is there a problem within the code? If anybody can provide any help, I would be so grateful!