def SplitRandOut(self, strip): color = Color(randint(0, 255), randint(0, 255), randint(0, 255)) frame1 = KeyFrame(self.StepDef, strip, delay=50, color=color) self.AddFrame(frame1) frame2 = KeyFrame(self.StepDef, strip, delay=50, color=Color(0, 0, 0)) self.AddFrame(frame2) return self
def SplitRandIn(self, strip): color = Color(randint(0, 255), randint(0, 255), randint(0, 255)) frame1 = KeyFrame(self.StepDef, strip, delay=50, color=color) self.AddFrame(frame1) frame1 = KeyFrame(self.StepDef, strip, delay=50, color=self.base_color) self.AddFrame(frame1) return self
def FadeRand(self, strip, iterations=1): for j in range(iterations): color = Color(randint(0, 255), randint(0, 255), randint(0, 255)) frame1 = KeyFrame(self.FadeDef, strip, stBright=0, edBright=self.max_brightness, col=color, delay=20) frame2 = KeyFrame(self.FadeDef, strip, stBright=self.max_brightness, edBright=-1, col=color, delay=20) self.AddFrame(frame1) self.AddFrame(frame2) return self
def FadeColoursOut(self, strip, colors, iterations=1): frame = KeyFrame(self.FadeDef, strip, stBright=self.max_brightness, edBright=0, col=self.base_color, delay=20) self.AddFrame(frame) for x in range(iterations): for j in colors: frame1 = KeyFrame(self.FadeDef, strip, stBright=0, edBright=self.max_brightness, col=j, delay=20) frame2 = KeyFrame(self.FadeDef, strip, stBright=self.max_brightness, edBright=-1, col=j, delay=20) self.AddFrame(frame1) self.AddFrame(frame2) return self
def WipeRandOut(self, strip, direction=1, iterations=1): ledCount = strip.numPixels() workingRange = self.CalculateRange(direction, ledCount) for x in range(iterations): for j in workingRange: frame1 = KeyFrame(self.WipeDef, strip, pos=j, col=Color(randint(0, 255), randint(0, 255), randint(0, 255)), delay=40) self.AddFrame(frame1) for j in workingRange: frame1 = KeyFrame(self.WipeDef, strip, pos=j, col=Color(0,0,0), delay=40) self.AddFrame(frame1) return self
def BounceRand(self, strip, iterations=2): color = Color(randint(0, 255), randint(0, 255), randint(0, 255)) for j in range(iterations): frame1 = KeyFrame(self.Left, strip, delay=30, color=color, size=4) frame2 = KeyFrame(self.Right, strip, delay=30, color=color, size=4) self.AddFrame(frame1) self.AddFrame(frame2) frame3 = KeyFrame(self.FadeDef, strip, stBright=0, edBright=self.max_brightness, col=self.base_color, delay=20) self.AddFrame(frame3) return self
def WipeOut(self, strip, direction=1, color=Color(0,0,255)): ledCount = strip.numPixels() workingRange = self.CalculateRange(direction, ledCount) for j in workingRange: frame2 = KeyFrame(self.WipeDef, strip, pos=j, col=Color(0,0,0), delay=40) self.AddFrame(frame2) return self
def FadeIn(self, strip): frame1 = KeyFrame(self.FadeDef, strip, stBright=0, edBright=self.max_brightness, col=self.base_color, delay=20) self.AddFrame(frame1) return self
def SplitOut(self, strip): frame1 = KeyFrame(self.StepDef, strip, delay=50, color=Color(0, 0, 0)) self.AddFrame(frame1) return self
def SplitIn(self, strip): frame1 = KeyFrame(self.StepDef, strip, delay=50, color=self.base_color) self.AddFrame(frame1) return self
def BuildIn(self, strip, color=Color(30, 30, 90)): #colours = self.GenerateRandomColours() frame1 = KeyFrame(self.BuildDef, strip, colours=color, delay=30) self.AddFrame(frame1) return self