PowerPoint.SlideBackgroundSolidFillOptions interface
表示可用于设置 PowerPoint.SlideBackground 纯色填充的选项。
注解
使用方
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/slide-management/get-set-background-fill.yaml
// Sets the background of the first selected slide to a solid orange fill at 20% transparency.
await PowerPoint.run(async (context) => {
const slide: PowerPoint.Slide = context.presentation.getSelectedSlides().getItemAt(0);
slide.background.fill.setSolidFill({
color: "#FF8C00",
transparency: 0.2,
} as PowerPoint.SlideBackgroundSolidFillOptions);
await context.sync();
console.log("Background set to solid orange fill (20% transparent).");
});
属性
| color | 如果提供,则以 HTML 颜色格式指定填充颜色, (例如“#FFA500”或“橙色”) 。 |
| transparency | 如果提供,则将填充的透明度百分比指定为从 0.0 (不透明) 到 1.0 (透明) 的值。 |
属性详细信息
color
如果提供,则以 HTML 颜色格式指定填充颜色, (例如“#FFA500”或“橙色”) 。
color?: string;
属性值
string
注解
transparency
如果提供,则将填充的透明度百分比指定为从 0.0 (不透明) 到 1.0 (透明) 的值。
transparency?: number;
属性值
number