I have been trying to figure out how to change the background color of a slide in Apps Script. I have tried setConcreteColor(DARK1, "#FF00FF");
, and the error code is ReferenceError: DARK1 is not defined
. Can someone please help?
Recommended Solution:
You can use the setSolidFill() method. You may refer to this sample script below to change a slide page background color:
Script:
function myFunction() {
var hex_color = '#2a2a2a'; //The background color set in dark gray
var selection = SlidesApp.getActivePresentation().getSelection();
var currentPage = selection.getCurrentPage();
var bg = currentPage.getBackground();
bg.setSolidFill(hex_color);
}
Result:
From this:
To this:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.