PPTX

Effects and Fills

Apply shadows, glow, 3D effects, and various fill types to shapes

Enhance shapes with visual effects (shadows, glow, 3D) and fills (solid, gradient, image, transparent).

Solid Fill

import { generatePresentation } from "@office-open/pptx";
{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "10.6cm",
            "height": "6.6cm",
            "fill": { "type": "solid", "color": "2E74B5" }
          }
        }
      ]
    }
  ]
}

Short form — pass a color string directly:

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "10.6cm",
            "height": "6.6cm",
            "fill": "2E74B5"
          }
        }
      ]
    }
  ]
}

Gradient Fill

Linear Gradient (with angle)

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "15.9cm",
            "height": "6.6cm",
            "fill": {
              "type": "gradient",
              "stops": [
                { "position": 0, "color": "0D47A1" },
                { "position": 100, "color": "42A5F5" }
              ],
              "angle": 45
            }
          }
        }
      ]
    }
  ]
}

Radial Gradient (with path)

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "10.6cm",
            "height": "10.6cm",
            "geometry": "ellipse",
            "fill": {
              "type": "gradient",
              "stops": [
                { "position": 0, "color": "FFFFFF" },
                { "position": 100, "color": "1565C0" }
              ],
              "path": "circle"
            }
          }
        }
      ]
    }
  ]
}

Multi-stop Gradient

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "15.9cm",
            "height": "6.6cm",
            "fill": {
              "type": "gradient",
              "stops": [
                { "position": 0, "color": "E53935" },
                { "position": 50, "color": "FF9800" },
                { "position": 100, "color": "FFEB3B" }
              ],
              "angle": 90
            }
          }
        }
      ]
    }
  ]
}

Image Fill (Blip Fill)

The data field accepts raw bytes (Uint8Array, ArrayBuffer, Buffer) or a base64 data URL such as data:image/png;base64,....

import * as fs from "node:fs";
import { generatePresentation } from "@office-open/pptx";
{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "15.9cm",
            "height": "9.3cm",
            "fill": {
              "type": "blip",
              "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
              "imageType": "png"
            }
          }
        }
      ]
    }
  ]
}

No Fill (Transparent)

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "13.2cm",
            "height": "6.6cm",
            "fill": { "type": "none" },
            "outline": { "color": "2E74B5", "width": 2 }
          }
        }
      ]
    }
  ]
}

Outline

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "13.2cm",
            "height": "6.6cm",
            "fill": { "type": "solid", "color": "E3F2FD" },
            "outline": {
              "color": "1565C0",
              "width": "0.1cm",
              "dashStyle": "solid"
            }
          }
        }
      ]
    }
  ]
}

Effects

Use the effects property for shadows, glow, reflection, soft edge, and 3D effects:

Outer Shadow

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "5.3cm",
            "height": "3.2cm",
            "fill": "ED7D31",
            "effects": {
              "outerShadow": {
                "blur": 50800,
                "distance": 38100,
                "direction": 5400000,
                "color": "000000",
                "alpha": 50
              }
            }
          }
        }
      ]
    }
  ]
}

Inner Shadow

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "5.3cm",
            "height": "3.2cm",
            "fill": "5B9BD5",
            "effects": {
              "innerShadow": {
                "blur": 40000,
                "distance": 30000,
                "direction": 5400000,
                "color": "000000",
                "alpha": 40
              }
            }
          }
        }
      ]
    }
  ]
}

Glow

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "5.3cm",
            "height": "3.2cm",
            "fill": "70AD47",
            "effects": {
              "glow": {
                "radius": 152400,
                "color": "92D050",
                "alpha": 60
              }
            }
          }
        }
      ]
    }
  ]
}

Reflection

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "5.3cm",
            "height": "3.2cm",
            "fill": "FFC000",
            "effects": {
              "reflection": {
                "blurRadius": 6350,
                "distance": 38100,
                "direction": 5400000,
                "startAlpha": 90,
                "endAlpha": 0
              }
            }
          }
        }
      ]
    }
  ]
}

Soft Edge

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "5.3cm",
            "height": "3.2cm",
            "fill": "BF8F00",
            "effects": {
              "softEdge": { "radius": 50800 }
            }
          }
        }
      ]
    }
  ]
}

3D Rotation and Bevel

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "5.3cm",
            "height": "4.0cm",
            "fill": "FFC000",
            "effects": {
              "rotation3D": {
                "x": "0.5cm",
                "y": "0.8cm",
                "z": 10,
                "perspective": 500
              },
              "bevelTop": { "width": 8, "height": 8 },
              "extrusionH": 50000,
              "material": "plastic"
            }
          }
        }
      ]
    }
  ]
}

Combined Effects

Multiple effects can be applied simultaneously:

{
  "slides": [
    {
      "children": [
        {
          "shape": {
            "x": "1.3cm",
            "y": "1.3cm",
            "width": "5.3cm",
            "height": "3.2cm",
            "fill": "7030A0",
            "effects": {
              "outerShadow": {
                "blur": 40000,
                "distance": 30000,
                "direction": 2700000,
                "color": "000000",
                "alpha": 40
              },
              "glow": { "radius": 101600, "color": "B381E7", "alpha": 35 }
            }
          }
        }
      ]
    }
  ]
}

Effects Options

PropertyTypeDescription
outerShadowShadowOptionsOuter drop shadow
innerShadowShadowOptionsInner shadow
glowGlowOptionsGlow effect
reflectionReflectionOptionsReflection effect
softEdgeSoftEdgeOptionsSoft edge effect
rotation3DRotation3DOptions3D rotation
bevelTopPPTXBevelOptionsTop bevel
bevelBottomPPTXBevelOptionsBottom bevel
extrusionHnumberExtrusion height (EMU)
materialstringMaterial type
lightingstringLighting type
Copyright © 2026