python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

how to read font color!

Open qihangsheji opened this issue 2 years ago • 4 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

qihangsheji avatar Jan 18 '24 14:01 qihangsheji

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

ME-researchgroup avatar Jan 23 '24 14:01 ME-researchgroup