Change shape background color

Easily change a shape's interior color

  • Select the shape by name you want to modify. See here to find shape names.

  • Set the fill_color property inside the settings object to change a shape’s background color.

  • Define fill_color with a:

    • Hex code (e.g. "#000000") or

    • RGB (e.g. "0,0,0") or

    • Color name (e.g. "black")

Reference: shapes

Download: input.zip | output.pptx


{
  "presentation": {
    "template": "template.pptx",
    "slides": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "Rectangle 1",
            "settings": {
              "fill_color": "#C916D4"
            }
          },
          {
            "name": "Rectangle 5",
            "settings": {
              "fill_color": "255, 165, 119"
            }
          },
          {
            "name": "Chart 6",
            "settings": {
              "fill_color": "beige"
            }
          }
        ]
      }
    ]
  }
}

{
   "presentation": {
      "template": "slides_as_template_fill_color.pptx",
      "slides": [
         {
            "slide_index": 0,
            "shapes": [
               {
                  "name": "TextBox 4",
                  "content": "Text box",
                  "settings": {
                     "fill_color": "#f5f5dc"
                  }
               },
               {
                  "name": "Rectangle 5",
                  "settings": {
                     "fill_color": "245, 245, 220"
                  }
               },
               {
                  "name": "Chart 8",
                  "settings": {
                     "fill_color": "beige"
                  }
               }
            ]
         }
      ]
   }
}

Last updated

Was this helpful?