Skip to content

ShapeFill

Defined in: src/core/document-model/types.ts:1188

A shape’s fill: none, a solid colour, a ShapeGradient, or a picture.

readonly optional alpha?: number

Defined in: src/core/document-model/types.ts:1257

§20.1.2.3.1 a:alpha / §14.1.2.5 @opacity — how opaque the fill is, 0..1. Absent is opaque. The colour above is the fill’s own, NOT composited over the paper: what is behind the shape shows through it.


readonly optional colorHex?: string

Defined in: src/core/document-model/types.ts:1190


readonly optional duotone?: object

Defined in: src/core/document-model/types.ts:1245

§20.1.8.23 a:duotone — the picture recoloured into two tones: its dark end becomes the first colour, its light end the second. An Office theme that ships a photograph tints it this way, so a deck whose background is a brown ridged texture is stored as a grey one (corpus: themes.pptx).

readonly highlightHex: string

readonly shadowHex: string


readonly optional gradient?: ShapeGradient

Defined in: src/core/document-model/types.ts:1191


readonly optional imageCrop?: ImageCrop

Defined in: src/core/document-model/types.ts:1230

§20.1.8.30 a:stretch/a:fillRect (or an a:srcRect beside it) — the part of the picture the box shows, as the fractions cut from each side.


readonly optional imageFillRect?: object

Defined in: src/core/document-model/types.ts:1246

readonly bottom: number

readonly left: number

readonly right: number

readonly top: number


readonly optional imageResource?: ResourceId

Defined in: src/core/document-model/types.ts:1225

§20.1.8.14 a:blipFill — the picture painted across the shape’s box. A DrawingML picture IS a shape with one of these, which is how a pic:pic inside a group reaches the page.


readonly kind: ShapeFillKind

Defined in: src/core/document-model/types.ts:1189


readonly optional tiled?: boolean

Defined in: src/core/document-model/types.ts:1197

§14.1.2.5 @type="tile" — the picture REPEATS at its own size rather than stretching over the box. A parchment behind a page, a texture behind a text box: stretched, such a fill is a blur where it should be a pattern.


readonly optional tileFromCentre?: boolean

Defined in: src/core/document-model/types.ts:1219

Where the grid of copies is anchored. DrawingML pins it to the shape’s top-left corner (§20.1.8.58 a:tile @algn, which defaults to tl); an MS-ODRAW texture fill (§2.3.7.13 fillOriginX/fillOriginY, both defaulting to nothing) centres it on the shape instead. It only shows when the copies do not divide the box evenly — and it shows most when ONE copy is larger than the box, where the difference is which part of the picture is visible at all.


readonly optional tileScale?: object

Defined in: src/core/document-model/types.ts:1209

§20.1.8.58 a:tile @sx @sy — how far the picture is scaled BEFORE it is repeated, as fractions of its own size (1 = 100 %). A texture halved tiles four times as often, and read as a plain repeat it tiles once.

readonly sx: number

readonly sy: number


readonly optional tileSizePt?: object

Defined in: src/core/document-model/types.ts:1203

The size ONE copy of a tiled fill occupies, when the shape states it — MS-ODRAW §2.3.7.11/.12 fillWidth / fillHeight. Absent, a tile is the picture at its own resolution, which is the default both formats give.

readonly heightPt: number

readonly widthPt: number