如何在Python-Pptx中读取AutoShape的颜色?
彩色圆圈是Python-Pptx中的AutoShape类型,现在我想阅读
我在文档中获得
shape.fill.solid()
shape.fill.fore_color.rgb
的颜色(RGB或其他任何内容) ,但它弹出了
AttributeError: no .rgb property on color type '_NoneColor'
任何想法来访问颜色汽车?
(顺便说一句,最好发布颜色变化方法,因为我读了颜色以通过HSV调整来更改它)
Colorful circles are the autoshape type in python-pptx, Now I want to read the color(RGB or whatever) of them
What I got in documentation is use
shape.fill.solid()
shape.fill.fore_color.rgb
But It pops
AttributeError: no .rgb property on color type '_NoneColor'
Any idea to access the color of autoshape?
(BTW, Best to post the color change method cause I read color for change it by HSV adjustment)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要阅读主题/重音颜色。这是一个如何为字体执行此操作的示例,形状
python-pptx 非常相似:阅读字体颜色
You will need to read the theme/accent colour. Here is an example of how to do this for fonts, the process is rather similar for shapes
python-pptx: read font color