我一直在研究如何在 Apps Script 中更改幻灯片的背景颜色。我试过 setConcreteColor(DARK1, "#FF00FF");
,错误代码是 ReferenceError: DARK1 is not defined
。有人可以帮忙吗?
答案 0 :(得分:0)
推荐的解决方案:
您可以使用 setSolidFill() 方法。您可以参考下面的示例脚本来更改幻灯片页面的背景颜色:
脚本:
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);
}
结果:
从这里:
为此: