I'm trying to create pulsing background in my app. Following this question Pulsing Background Color in Kivy
i've tried to make it work also, but for some reason it doesn't work. Here's my main.py
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
from kivy.core.window import Window
from kivymd.app import MDApp
from kivy.uix.image import Image
from kivy.animation import Animation
from kivy.clock import Clock
Window.size = (360,600)
class MyGridLayout(Screen):
def blink(self):
x = Clock.schedule_once(self.start_pulsing,2)
return x
def start_pulsing(self,*args):
anim = Animation(animated_color=(1,0,0,1))
anim.start(self)
anim.repeat = True
class mainApp(App):
def build(self):
return MyGridLayout()
if __name__ == '__main__':
mainApp().run()
And my main.kv file
<MyGridLayout>:
FloatLayout:
size: root.width, root.height
animated_color:(1,1,1,1)
canvas.before:
Color:
rgba :self.animated_color
Rectangle:
pos: self.pos
size: self.size
Any help will be much appreciated