通过


PowerPoint.SlideBackgroundSolidFillOptions interface

表示用于设置 PowerPoint.SlideBackground 纯色填充的可用选项。

注解

[ API 集:PowerPointApi 1.10 ]

示例

// 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”或“orange”) 。

transparency

如果提供,则将填充的透明度百分比指定为从 0.0 (不透明) 到 1.0 (清除) 的值。

属性详细信息

color

如果提供,则指定 HTML 颜色格式的填充颜色 (例如“#FFA500”或“orange”) 。

color?: string;

属性值

string

注解

[ API 集:PowerPointApi 1.10 ]

transparency

如果提供,则将填充的透明度百分比指定为从 0.0 (不透明) 到 1.0 (清除) 的值。

transparency?: number;

属性值

number

注解

[ API 集:PowerPointApi 1.10 ]