diff --git a/animation.py b/animation.py index 30e92fc..1fa4774 100644 --- a/animation.py +++ b/animation.py @@ -48,9 +48,9 @@ class RandomSingle(Animation): by Max & Lightmoll (https://lght.ml) from 2022-06-08 """ - def __init__(self, color): + def __init__(self, color, looptime=60): super().__init__() - self.PERIOD = 4 * 30 #frames + self.PERIOD = looptime * 30 #frames self.color = self._rand_color() self.last_colors = [] self.frame_counter = 0 @@ -92,10 +92,10 @@ class TwoColor(Steady): by Max & Lightmoll (https://lght.ml) from 2022-06-08 """ - def __init__(self, color): + def __init__(self, color, looptime=60): super().__init__(color) self.start_time = time() - self.PERIOD = 0.5 #s + self.PERIOD = looptime * 0.5 #s self.COL_1 = color #input color self.COL_2 = (255-self.r, 255-self.g, 255-self.b) #compl. color @@ -174,7 +174,7 @@ class Caramelldansen(Steady): class FadeTo(Steady): - def __init__(self, color, t=2.0): + def __init__(self, color, t=60.0): super(FadeTo, self).__init__(color) self.t = t self.start = time() @@ -192,7 +192,7 @@ class FadeTo(Steady): class RotatingRainbow(Animation): - def __init__(self, looptime=10.0): + def __init__(self, looptime=60.0): super(RotatingRainbow, self).__init__() self.looptime = looptime pass @@ -216,7 +216,7 @@ class RotatingRainbow(Animation): class Chase(Steady): - def __init__(self, color, looptime=1.0): + def __init__(self, color, looptime=60.0): super(Chase, self).__init__(color) self.looptime = looptime @@ -234,7 +234,7 @@ class Chase(Steady): class ChaseRandom(Animation): - def __init__(self, color, looptime=1.0): + def __init__(self, color, looptime=60.0): super(Chase, self).__init__(color) self.looptime = looptime @@ -256,4 +256,4 @@ def hsv_to_rgb(h, s, v): return [int(r * 255), int(g * 255), int(b * 255)] def rgb_to_hsv(r, g, b): - return colorsys.rgb_to_hsv(r/255,g/255,b/255) \ No newline at end of file + return colorsys.rgb_to_hsv(r/255,g/255,b/255)