Set font color and font background color

  1. Find the shape name you want to update. See here to find shape names.

  2. Specify the text need amending under text_run. Text within one textbox can be split into multiple chunks.

  3. Add font color setting font_color or font backgrount stetting font_bg_color for selected text under text_properties.

  4. Insert either color name (e.g. black), RGB (e.g. 0,0,0), or Hex (e.g. #000000) as value for font_color and font_bg_color

  5. Insert new_line as boolean before another text_run.

Before and After

Template Presentation

JSON Payload

{
  "presentation": {
    "template": "slides_as_template_text_font_color.pptx",
    "export_version": "Pptx2010",
    "slides": [
      {
        "type": "slide",
        "slide_index": 0,
        "shapes": [
          {
            "name": "Title 1",
            "text_content": [
              {
                "text_run": "Text color",
                "text_properties": {
                  "font_color": "147, 147, 132",
                  "new_line": true
                }
              },
              {
                "text_run": "Text background color",
                "text_properties": {
                  "font_bg_color": "#f5f5dc",
                  "new_line": true
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

Last updated