scanny / python-pptx

Create Open XML PowerPoint documents in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to read font color!

qihangsheji opened this issue · comments

Most of the time, it's not available.
font.color.type is None , But in fact there are colors
for paragraph in shape.text_frame.paragraphs: print("paragraph") print(paragraph.font.color.type) for run in paragraph.runs: # 提取文本内容、字体、大小和颜色 print("run") print(run.font.color.type) font_name = run.font.name #font_size = run.font.size.pt # 字体大小(以磅为单位) font_color = run.font.color

have you tried reading the rgb value from run.font.color.rgb?