python - Changing default color of text -
in order change default color of text in app black, tried setting color
property inside <label>
0,0,0,1
.
color:
text color, in format (r, g, b, a).
color listproperty , defaults [1, 1, 1, 1].
this makes text black regardless of markup color used. example code @ bottom of post creates 3 buttons black text when color: 0,0,0,1
:
and expected white, red, green text color when color: 1,1,1,1
:
i assuming color
applied after markup coloring, causing problem described above.
question:
correct way change default color of text?
kivy version: 1.9.0
from kivy.app import app kivy.uix.boxlayout import boxlayout kivy.lang import builder kv = """ <label>: markup: true color: 0,0,0,1 # defaults 1,1,1,1 when not used <mywidget>: orientation: 'vertical' button: text: 'no markup text' button: text: '[color=ff0000]red markup[/color]' button: text: '[color=7fff00]green markup[/color]' """ builder.load_string(kv) class mywidget(boxlayout): pass class mybuttonsapp(app): def build(self): return mywidget() if __name__ == '__main__': mybuttonsapp().run()
Comments
Post a Comment