PowerPoint.ThemeColor enum
指定 PowerPoint 中使用的主题颜色。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/slide-management/get-set-theme-color-scheme.yaml
// Sets custom theme colors on the first slide and updates swatches if present.
await PowerPoint.run(async (context) => {
const slide = context.presentation.slides.getItemAt(0);
const colorScheme: PowerPoint.ThemeColorScheme = slide.themeColorScheme;
colorScheme.setThemeColor(PowerPoint.ThemeColor.accent1, "#C00000");
colorScheme.setThemeColor(PowerPoint.ThemeColor.accent2, "#FF6600");
colorScheme.setThemeColor(PowerPoint.ThemeColor.accent3, "#FFCC00");
colorScheme.setThemeColor(PowerPoint.ThemeColor.accent4, "#92D050");
colorScheme.setThemeColor(PowerPoint.ThemeColor.accent5, "#00B0F0");
colorScheme.setThemeColor(PowerPoint.ThemeColor.accent6, "#7030A0");
await context.sync();
await updateSwatches(context, slide);
console.log("Custom accent colors applied to slide 1.");
});
字段
| accent1 = "Accent1" | 指定“强调文字颜色 1”主题颜色。 |
| accent2 = "Accent2" | 指定“强调文字颜色 2”主题颜色。 |
| accent3 = "Accent3" | 指定“强调文字颜色 3”主题颜色。 |
| accent4 = "Accent4" | 指定“强调文字颜色 4”主题颜色。 |
| accent5 = "Accent5" | 指定“强调文字颜色 5”主题颜色。 |
| accent6 = "Accent6" | 指定“强调文字颜色 6”主题颜色。 |
| dark1 = "Dark1" | 指定“深色 1”主题颜色。 |
| dark2 = "Dark2" | 指定“深色 2”主题颜色。 |
| followedHyperlink = "FollowedHyperlink" | 指定单击的超链接主题颜色。 |
| hyperlink = "Hyperlink" | 指定超链接主题颜色。 |
| light1 = "Light1" | 指定“浅色 1”主题颜色。 |
| light2 = "Light2" | 指定浅色 2 主题颜色。 |
| mixed = "Mixed" | 指定混合主题颜色。 |
| none = "None" | 指定无主题颜色。 |