[英]how to change colour of specific words in a powerpoint in python
你會這樣做:
from pptx.dml.color import RGBColor
font.color.rgb = RGBColor(0x80, 0x18, 0x18)
此外,如果您正在為多個單詞/句子着色:
from pptx.util import Pt
p = tf.add_paragraph()
run = p.add_run()
blue = p.add_run()
blue.text = 'this is blue'
blue.font.color.rgb = RGBColor(0, 0, 255)
run.text = 'this is red'
run.font.color.rgb = RGBColor(178,34,34)
Python-pptx 文檔:鏈接
RGB colors:鏈接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.