i have a simple app . i want to change text color (say, red) before that i want to copy default text color and
i want text color according to theme dark or light .
so after changing text color to red again i can set default text color according to theme
.
####### see this code text color showing None
from kivy.lang import Builder
from
kivymd.app import MDApp
KV = '''
MDScreen:
md_bg_color: self.theme_cls.backgroundColor
BoxLayout:
orientation:'vertical'
MDLabel:
text: "MDLabel"
halign: "center"
id:lbl
Button:
size_hint:None,None
size:'48dp','48dp'
on_release:app._call()
'''
class Example(MDApp):
def build(self):
return Builder.load_string(KV)
def _call(self):
self.theme_cls.theme_style = "Dark" if self.theme_cls.theme_style=='Light' else 'Light'
print(self.root.ids.lbl.text_color)
if __name__=='__main__':
Example().run()