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:

enter image description here

and expected white, red, green text color when color: 1,1,1,1:

enter image description here

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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -