3
from pptx import Presentation
from pptx.dml.color import RGBColor
prs=Presentation()
title_slide_layout=prs.slide_layouts[0]
slide=prs.slides.add_slide(title_slide_layout)
background=slide.background
fill = background.fill
fill.solid()
fill.fore_color.rgb = RGBColor(59, 89, 152)
title=slide.shapes.title
subtitle=slide.placeholders[1]
title.text="title"
subtitle.text="Subtitle"
prs.save('mynewone.pptx')

i tired to change the same i changed the backgroud but i dint work

KEYAN TECH
  • 105
  • 1
  • 8

1 Answers1

5

You need to handle the shape's text_frame property and apply that font formatting to the paragraphs. I think this should work, according to the documentation:

title.text_frame.paragraphs[0].font.color.rgb = RGBColor(59,89, 152)
David Zemens
  • 53,033
  • 11
  • 81
  • 130