有没有机会使RstDocument在Kivy中透明化?有一个dict属性colors,可用于设置颜色:class TipRstDocument(RstDocument): colors = DictProperty({ 'background': '000000', 'link': 'ce5c00', 'paragraph': '202020', 'title': '204a87', 'bullet': '000000'})但是如何设置透明度?
2 回答

萧十郎
TA贡献1815条经验 获得超13个赞
每个Kivy小部件都有一个Opacity属性,可用于设置小部件及其子级的不透明度。因此,您只需执行rst_doc_instance.opacity = .5即可将实例的不透明度更改为50%。
更新:自1.7.2-dev起,RstDoc现在具有background_color属性,该属性可用于根据您的偏好设置背景色。
因此,在您的情况下:
RstDocument:
background_color: 1, 1, 1, .5 # 50 translucent white
添加回答
举报
0/150
提交
取消