def next_scene(self, i): if i % 2 == 0: sceneFactory = Yellow() else: sceneFactory = Cyan() return sceneFactory.scene()
def next_scene(self, i): if i % 3 == 0: sceneFactory = Yellow() elif i % 3 == 1: sceneFactory = Cyan() else: sceneFactory = Purple() return sceneFactory.scene()
def next_scene(self, i): red = Red().scene() green = Green().scene() cyan = Cyan().scene() blue = Blue().scene() purple = Purple().scene() yellow = Yellow().scene() blackout = Blackout().scene() white = White().scene() strobe = WhiteStrobeLow().scene() flash = withFlash(Blackout().scene()) chainStrobe = [ blackout, white, blackout, white, blackout, blackout, blackout, white, blackout, white, blackout, blackout, flash, blackout, blackout, blackout, flash, white, blackout, white, blackout, blackout, blackout, white, blackout, white, blackout, blackout, flash, blackout, blackout, blackout, flash, white, blackout, white, blackout, blackout, blackout, white, blackout, white, blackout, blackout, flash, white, white, white, white, white, white, white, blackout, blackout, blackout, red, blackout, red, blackout, blackout, blackout ] chainStrobe += chainStrobe chain = [blackout] if i < len(chainStrobe): return chainStrobe[i % (len(chainStrobe))] else: return chain[(i - len(chainStrobe)) % (len(chain))]
def next_scene(self, i): wait = [{"type": "wait", "duration": 0.05}] return Yellow().scene() + wait + Red().scene()
def next_scene(self, i): return withFlash(Yellow().scene())
def withFlash(effect): wait = [{"type": "wait", "duration": 0.05}] return Yellow().scene() + wait + effect