📜  更改文本颜色 docx-python 代码示例

📅  最后修改于: 2022-03-11 14:47:11.104000             🧑  作者: Mango

代码示例1
from docx import Document
from docx.shared import RGBColor
document = Document()
run = document.add_paragraph().add_run('some text')
font = run.font
font.color.rgb = RGBColor(0x42, 0x24, 0xE9)
p=document.add_paragraph('aaa')
document.save('demo1.docx')