Set font color and font background color

  1. Select the shape by name you want to modify. 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",
    "slides": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "Title 1",
            "text": [
              {
                "text_run": "Text color",
                "text_properties": {
                  "font_color": "147, 147, 132"
                }
              },
              {
                "text_run": "Text background color",
                "text_properties": {
                  "font_bg_color": "#f5f5dc"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

Last updated

Was this helpful?