> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fill, line and effects

## `ShapeFill`

`PowerPoint.ShapeFill`.

Import from `@reductoai/pptx/officejs`.

### ShapeFill properties

| Name | Type | Description |
| - | - | - |
| `foregroundBrightness` | `number` | Extension (VBA `FillFormat.ForeColor.Brightness`): -1 (black) to 1 (white) over the solid fill's colour. |
| `foregroundColor` | `string` | |
| `foregroundThemeColor` | `ShapeThemeColor \| null` | Extension (VBA `FillFormat.ForeColor.ObjectThemeColor`): the solid fill's theme colour; null for RGB. |
| `gradientAngle` | `number` | Extension (VBA `FillFormat.GradientAngle`): clockwise degrees, 0 = left to right. |
| `gradientFocus` | `GradientFocus` | Extension (`a:fillToRect`): where a path gradient starts, as insets of the shape box (0–1). |
| `gradientStops` | `GradientStops` | read-only Extension (VBA `FillFormat.GradientStops`). |
| `transparency` | `number` | |
| `type` | `ShapeFillType` | read-only |

### `ShapeFill.clear()`

```ts theme={null}
clear(): void
```

### `ShapeFill.removeGradient()`

```ts theme={null}
removeGradient(): void
```

Extension (Shape Fill > Gradient > No Gradient): a gradient becomes its first stop's solid colour.

### `ShapeFill.setBackground()`

```ts theme={null}
setBackground(): void
```

Extension (VBA `FillFormat.Background`): the shape shows the slide background (`p:sp@useBgFill`).

### `ShapeFill.setGradientFill()`

```ts theme={null}
setGradientFill(options?: { type?: GradientFillType }): void
```

Extension, as `SlideBackgroundFill.setGradientFill`: two stops from the fill colour to its shade.

### `ShapeFill.setGradientPreset()`

```ts theme={null}
setGradientPreset(variation: GradientVariation, direction: GradientDirection): void
```

Extension (Shape Fill > Gradient): a Light or Dark Variation of the fill's colour in one of the
gallery's directions. A gradient fill keeps its stops and takes the direction.

### `ShapeFill.setImage()`

```ts theme={null}
setImage(base64EncodedImage: string | Uint8Array<ArrayBufferLike>): void
```

Also takes the image's bytes.

### `ShapeFill.setSolidColor()`

```ts theme={null}
setSolidColor(color: string): void
```

## `ShapeLineFormat`

`PowerPoint.ShapeLineFormat` over `a:ln`.

Import from `@reductoai/pptx/officejs`.

### ShapeLineFormat properties

| Name | Type | Description |
| - | - | - |
| `beginArrowheadLength` | `ArrowheadLength` | Extension (Excel `ShapeLineFormat.beginArrowheadLength`). |
| `beginArrowheadStyle` | `ArrowheadStyle` | Extension (Excel `ShapeLineFormat.beginArrowheadStyle`, `a:headEnd@type`). |
| `beginArrowheadWidth` | `ArrowheadWidth` | Extension (Excel `ShapeLineFormat.beginArrowheadWidth`). |
| `brightness` | `number` | Extension (VBA `LineFormat.ForeColor.Brightness`): -1 (black) to 1 (white) over the line colour. |
| `capStyle` | `ShapeLineCapStyle` | Extension (`a:ln@cap`): how the line's ends and dashes finish; Square when unstated. |
| `color` | `string` | |
| `dashStyle` | `ShapeLineDashStyle` | |
| `endArrowheadLength` | `ArrowheadLength` | Extension (Excel `ShapeLineFormat.endArrowheadLength`). |
| `endArrowheadStyle` | `ArrowheadStyle` | Extension (Excel `ShapeLineFormat.endArrowheadStyle`, `a:tailEnd@type`). |
| `endArrowheadWidth` | `ArrowheadWidth` | Extension (Excel `ShapeLineFormat.endArrowheadWidth`). |
| `gradientAngle` | `number` | Extension (VBA `FillFormat.GradientAngle`) over the line's gradient: clockwise degrees. |
| `gradientStops` | `GradientStops` | read-only Extension (VBA `FillFormat.GradientStops`) over the line's `a:gradFill`. |
| `joinStyle` | `ShapeLineJoinStyle` | Extension (`a:round`, `a:bevel`, `a:miter`): how the line turns a corner; Round when unstated. |
| `presetDash` | `PresetLineDash` | Extension: the `a:prstDash` value itself, as Table Design's Pen Style writes it. |
| `style` | `ShapeLineStyle` | |
| `themeColor` | `ShapeThemeColor \| null` | Extension (VBA `LineFormat.ForeColor.ObjectThemeColor`): the line's theme colour; null for RGB. |
| `transparency` | `number` | |
| `visible` | `boolean` | |
| `weight` | `number` | Line width in points. |

### `ShapeLineFormat.setGradientFill()`

```ts theme={null}
setGradientFill(options?: { type?: GradientFillType }): void
```

Extension, as `ShapeFill.setGradientFill`: a two-stop gradient outline from the line colour to its shade.

## `GradientStops`

VBA `GradientStops`. A gradient keeps at least two stops, as in PowerPoint.

Import from `@reductoai/pptx/officejs`.

### GradientStops properties

| Name | Type | Description |
| - | - | - |
| `count` | `number` | read-only |
| `items` | `GradientStop[]` | read-only |

### `GradientStops.delete()`

```ts theme={null}
delete(index: number): void
```

### `GradientStops.getItemAt()`

```ts theme={null}
getItemAt(index: number): GradientStop
```

### `GradientStops.insert()`

```ts theme={null}
insert(color: string, position: number, transparency?: number, index?: number): void
```

Adds a stop; without `index` it goes in position order.

## `ShadowFormat`

Extension (VBA `ShadowFormat`): an outer or inner shadow, `a:effectLst/a:outerShdw` or `a:innerShdw`.
A getter reads the first target; null when it has no shadow.

Import from `@reductoai/pptx/officejs`.

### ShadowFormat properties

| Name | Type | Description |
| - | - | - |
| `blur` | `number \| null` | Blur radius in points. |
| `color` | `string \| null` | `#RRGGBB`. |
| `offsetX` | `number \| null` | Horizontal offset in points; positive is right. |
| `offsetY` | `number \| null` | Vertical offset in points; positive is down. |
| `style` | `ShadowStyle \| null` | VBA `ShadowFormat.Style`: outside the shape (`a:outerShdw`) or inside its edge (`a:innerShdw`). |
| `transparency` | `number \| null` | 0 (opaque) to 1. |
| `visible` | `boolean` | |

## `GlowFormat`

Extension (VBA `GlowFormat`): a coloured, blurred outline, `a:effectLst/a:glow`.

Import from `@reductoai/pptx/officejs`.

### GlowFormat properties

| Name | Type | Description |
| - | - | - |
| `color` | `string \| null` | `#RRGGBB`. |
| `radius` | `number \| null` | In points. |
| `transparency` | `number \| null` | 0 (opaque) to 1. |
| `visible` | `boolean` | Extension: false removes the glow. |

## `ReflectionFormat`

Extension (VBA `ReflectionFormat`): a faded mirror copy below the shape, `a:effectLst/a:reflection`.

Import from `@reductoai/pptx/officejs`.

### ReflectionFormat properties

| Name | Type | Description |
| - | - | - |
| `blur` | `number` | Blur radius in points. |
| `offset` | `number` | Distance from the shape in points. |
| `size` | `number` | How much of the shape the reflection shows, in percent, `endPos`. |
| `transparency` | `number` | 0 (opaque) to 1 at the start of the fade, `stA`. |
| `type` | `ReflectionType` | |

## `SoftEdgeFormat`

Extension (VBA `SoftEdgeFormat`): edges that fade out, `a:effectLst/a:softEdge`.

Import from `@reductoai/pptx/officejs`.

### SoftEdgeFormat properties

| Name | Type | Description |
| - | - | - |
| `radius` | `number` | In points; 0 removes the soft edge. |

## `PictureFormat`

Headless extension, VBA `PictureFormat`; only on pictures (`p:pic`).

Import from `@reductoai/pptx/officejs`.

### PictureFormat properties

| Name | Type | Description |
| - | - | - |
| `crop` | `Crop` | read-only |
| `recolor` | `PictureRecolor \| undefined` | Extension (Color > Recolor): the gallery tile the picture shows; undefined for a recolor no tile writes. |
| `transparency` | `number` | Extension (Picture Transparency, `a:blip/a:alphaModFix`): 0 (opaque) to 1. |

### `PictureFormat.cropToAspectRatio()`

```ts theme={null}
cropToAspectRatio(width?: number, height?: number): void
```

Extension (Crop > Aspect Ratio): the largest frame of `width`:`height` inside this one,
centred, with the picture kept in place. Without a ratio, the picture's own.

### `PictureFormat.cropToFill()`

```ts theme={null}
cropToFill(): void
```

Extension (Crop > Fill): the whole picture, centred, covers the frame; the rest is cut.

### `PictureFormat.cropToFit()`

```ts theme={null}
cropToFit(): void
```

Extension (Crop > Fit): the whole picture, centred, shows inside the frame.

### `PictureFormat.setImage()`

```ts theme={null}
setImage(image: ImageSource): void
```

Extension (PowerPoint's Change Picture): shows another PNG, JPEG, GIF, EMF or WMF in this
picture, keeping its size, place, crop and effects. Other shapes showing the old image keep it.

## `Crop`

VBA `Crop`: the picture and its visible frame, both in slide points.

Import from `@reductoai/pptx/officejs`.

### Crop properties

| Name | Type | Description |
| - | - | - |
| `pictureHeight` | `number` | |
| `pictureOffsetX` | `number` | Picture centre minus frame centre, horizontally. |
| `pictureOffsetY` | `number` | |
| `pictureWidth` | `number` | |
| `shapeHeight` | `number` | |
| `shapeLeft` | `number` | |
| `shapeTop` | `number` | |
| `shapeWidth` | `number` | |
