PowerPoint.FillProperties interface
表示表格单元格的填充格式。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml
// Specifies the font formatting and fill colors of the cells in a table.
await PowerPoint.run(async (context) => {
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
// Add a table, specifying font formatting and fill colors
shapes.addTable(3, 4, {
values: [
["A", "BB", "CCC", "DDDD"],
["E", "FF", "GGG", "HHHH"],
["1", "12", "123", "1234"]
],
specificCellProperties: [
[
{ fill: { color: "red" }, font: { color: "yellow", name: "Calibri" } },
{ fill: { color: "#0048ba" }, font: { color: "yellow", name: "Coolvetica" } },
{ fill: { color: "red" }, font: { color: "yellow", italic: true } },
{ fill: { color: "red" }, font: { color: "#9966cc", strikethrough: true } }
],
[
{ fill: { color: "#fbceb1" }, font: { color: "yellow", doubleStrikethrough: true } },
{ fill: { color: "red" }, font: { color: "yellow", subscript: true } },
{ fill: { color: "#0048ba" }, font: { color: "yellow", superscript: true } },
{ fill: { color: "red" }, font: { color: "yellow" } }
],
[
{ fill: { color: "red" }, font: { color: "#b0bf1a" } },
{ fill: { color: "#9966cc" }, font: { color: "yellow" } },
{ fill: { color: "#b0bf1a" }, font: { color: "yellow" } },
{ fill: { color: "red" }, font: { color: "#fbceb1" } }
]
]
});
await context.sync();
});
属性
color | 表示十六进制格式的形状填充颜色,#RRGGBB (例如“FFA500”) 或作为命名的 HTML 颜色值 (例如“orange”) 。 |
transparency | 将填充的透明度百分比指定为从 0.0 (不透明) 到 1.0 (清除) 的值。 |
属性详细信息
color
表示十六进制格式的形状填充颜色,#RRGGBB (例如“FFA500”) 或作为命名的 HTML 颜色值 (例如“orange”) 。
color?: string | undefined;
属性值
string | undefined
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml
// Specifies the font formatting and fill colors of the cells in a table.
await PowerPoint.run(async (context) => {
const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;
// Add a table, specifying font formatting and fill colors
shapes.addTable(3, 4, {
values: [
["A", "BB", "CCC", "DDDD"],
["E", "FF", "GGG", "HHHH"],
["1", "12", "123", "1234"]
],
specificCellProperties: [
[
{ fill: { color: "red" }, font: { color: "yellow", name: "Calibri" } },
{ fill: { color: "#0048ba" }, font: { color: "yellow", name: "Coolvetica" } },
{ fill: { color: "red" }, font: { color: "yellow", italic: true } },
{ fill: { color: "red" }, font: { color: "#9966cc", strikethrough: true } }
],
[
{ fill: { color: "#fbceb1" }, font: { color: "yellow", doubleStrikethrough: true } },
{ fill: { color: "red" }, font: { color: "yellow", subscript: true } },
{ fill: { color: "#0048ba" }, font: { color: "yellow", superscript: true } },
{ fill: { color: "red" }, font: { color: "yellow" } }
],
[
{ fill: { color: "red" }, font: { color: "#b0bf1a" } },
{ fill: { color: "#9966cc" }, font: { color: "yellow" } },
{ fill: { color: "#b0bf1a" }, font: { color: "yellow" } },
{ fill: { color: "red" }, font: { color: "#fbceb1" } }
]
]
});
await context.sync();
});
transparency
将填充的透明度百分比指定为从 0.0 (不透明) 到 1.0 (清除) 的值。
transparency?: number | undefined;
属性值
number | undefined