Skip to content

@shbernal/ts-pptx


@shbernal/ts-pptx / index / BackgroundProps

Interface: BackgroundProps

Defined in: src/types/core.ts:79

Reusable optional data/path fields. Use DataOrPathRequiredProps for APIs that require at least one source.

Extends

Properties

color?

optional color?: string

Defined in: src/types/style.ts:144

Fill color

  • HexColor or ThemeColor

Examples

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

Inherited from

ShapeFillProps.color


data?

optional data?: string

Defined in: src/types/core.ts:76

base64-encoded string

  • Useful for avoiding potential path/server issues

Example

ts
'image/png;base64,iVtDafDrBF[...]=' // pre-encoded image in base-64

Inherited from

DataOrPathProps.data


gradient?

optional gradient?: GradientFillProps

Defined in: src/types/style.ts:173

Native PPTX gradient fill options.

Inherited from

ShapeFillProps.gradient


image?

optional image?: ImageFillProps

Defined in: src/types/style.ts:184

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

Inherited from

ShapeFillProps.image


path?

optional path?: string

Defined in: src/types/core.ts:69

URL or relative path

Example

ts
'https://onedrives.com/myimg.png` // retrieve image via URL
@example '/home/user/images/myimg.png` // retrieve image via local path

Inherited from

DataOrPathProps.path


pattern?

optional pattern?: PatternFillProps

Defined in: src/types/style.ts:178

Native PPTX pattern fill options.

Inherited from

ShapeFillProps.pattern


transparency?

optional transparency?: number

Defined in: src/types/style.ts:151

Transparency (percent)

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

Default

ts
0

Inherited from

ShapeFillProps.transparency


type?

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

Defined in: src/types/style.ts:168

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.

Default

ts
'solid'

Inherited from

ShapeFillProps.type