Kivy中RstDocument的透明度

有没有机会使RstDocument在Kivy中透明化?


有一个dict属性colors,可用于设置颜色:


class TipRstDocument(RstDocument):

    colors = DictProperty({

        'background': '000000',

        'link': 'ce5c00',

        'paragraph': '202020',

        'title': '204a87',

        'bullet': '000000'})

但是如何设置透明度?


qq_花开花谢_0
浏览 183回答 2
2回答

萧十郎

每个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    
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python