Skip to content

Interface: ShapeFillProps ​

Extended by ​

Properties ​

color? ​

optional color?: string

Fill color

  • HexColor or ThemeColor

Examples ​

ts
'FF0000' // hex color (red)
ts
SchemeColor.text1 // Theme color (Text1)

gradient? ​

optional gradient?: GradientFillProps

Native PPTX gradient fill options. Setting this (or type: 'gradient') paints the shape interior with a gradient instead of a color.


image? ​

optional image?: ImageFillProps

Native PPTX picture fill options. Setting this (or type: 'image') fills the shape interior with a stretched bitmap instead of a color.


pattern? ​

optional pattern?: PatternFillProps

Native PPTX pattern fill options. Setting this (or type: 'pattern') paints the shape interior with a two-color preset pattern instead of a color.


transparency? ​

optional transparency?: number

Transparency (percent)

  • MS-PPT > Format Shape > Fill & Line > Fill > Transparency
  • range: 0-100

Default ​

ts
0

type? ​

optional type?: "none" | "inherit" | "image" | "pattern" | "solid" | "gradient"

Fill type

'none' and 'inherit' are different states, and both have to be spelled out because omitting fill is not one of them: the shape/text-box emitter defaults a missing fill to <a:noFill/>.

  • 'none' emits <a:noFill/> — an explicit transparent interior.
  • 'inherit' emits no fill child at all, leaving the interior to p:style/a:fillRef or the placeholder. This is the only way to author that state from addShape/addText.

On a table cell (TableCellProps.fill) and a slide background the two spellings differ the same way, except that omitting the option there already means inherit, so 'inherit' is merely the explicit form of the default.

Omitting type is not the same as omitting the fill. Setting gradient, pattern or image selects that kind on its own — the sub-object is the statement, and type is how you say something the sub-objects cannot. Where both are given and they disagree, the explicit type wins and the sub-object is ignored, because that is the only rule under which { type: 'none', gradient } can still mean transparent.

Default ​

ts
'solid'