[hotfix] disable trap for photosensitive creatures #3
18
animation.py
18
animation.py
|
@ -48,9 +48,9 @@ class RandomSingle(Animation):
|
||||||
by Max & Lightmoll (https://lght.ml)
|
by Max & Lightmoll (https://lght.ml)
|
||||||
from 2022-06-08
|
from 2022-06-08
|
||||||
"""
|
"""
|
||||||
def __init__(self, color):
|
def __init__(self, color, looptime=60):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.PERIOD = 4 * 30 #frames
|
self.PERIOD = looptime * 30 #frames
|
||||||
self.color = self._rand_color()
|
self.color = self._rand_color()
|
||||||
self.last_colors = []
|
self.last_colors = []
|
||||||
self.frame_counter = 0
|
self.frame_counter = 0
|
||||||
|
@ -92,10 +92,10 @@ class TwoColor(Steady):
|
||||||
by Max & Lightmoll (https://lght.ml)
|
by Max & Lightmoll (https://lght.ml)
|
||||||
from 2022-06-08
|
from 2022-06-08
|
||||||
"""
|
"""
|
||||||
def __init__(self, color):
|
def __init__(self, color, looptime=60):
|
||||||
super().__init__(color)
|
super().__init__(color)
|
||||||
self.start_time = time()
|
self.start_time = time()
|
||||||
self.PERIOD = 0.5 #s
|
self.PERIOD = looptime * 0.5 #s
|
||||||
self.COL_1 = color #input color
|
self.COL_1 = color #input color
|
||||||
|
|
||||||
self.COL_2 = (255-self.r, 255-self.g, 255-self.b) #compl. 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):
|
class FadeTo(Steady):
|
||||||
def __init__(self, color, t=2.0):
|
def __init__(self, color, t=60.0):
|
||||||
super(FadeTo, self).__init__(color)
|
super(FadeTo, self).__init__(color)
|
||||||
self.t = t
|
self.t = t
|
||||||
self.start = time()
|
self.start = time()
|
||||||
|
@ -192,7 +192,7 @@ class FadeTo(Steady):
|
||||||
|
|
||||||
|
|
||||||
class RotatingRainbow(Animation):
|
class RotatingRainbow(Animation):
|
||||||
def __init__(self, looptime=10.0):
|
def __init__(self, looptime=60.0):
|
||||||
super(RotatingRainbow, self).__init__()
|
super(RotatingRainbow, self).__init__()
|
||||||
self.looptime = looptime
|
self.looptime = looptime
|
||||||
pass
|
pass
|
||||||
|
@ -216,7 +216,7 @@ class RotatingRainbow(Animation):
|
||||||
|
|
||||||
|
|
||||||
class Chase(Steady):
|
class Chase(Steady):
|
||||||
def __init__(self, color, looptime=1.0):
|
def __init__(self, color, looptime=60.0):
|
||||||
super(Chase, self).__init__(color)
|
super(Chase, self).__init__(color)
|
||||||
self.looptime = looptime
|
self.looptime = looptime
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ class Chase(Steady):
|
||||||
|
|
||||||
|
|
||||||
class ChaseRandom(Animation):
|
class ChaseRandom(Animation):
|
||||||
def __init__(self, color, looptime=1.0):
|
def __init__(self, color, looptime=60.0):
|
||||||
super(Chase, self).__init__(color)
|
super(Chase, self).__init__(color)
|
||||||
self.looptime = looptime
|
self.looptime = looptime
|
||||||
|
|
||||||
|
@ -256,4 +256,4 @@ def hsv_to_rgb(h, s, v):
|
||||||
return [int(r * 255), int(g * 255), int(b * 255)]
|
return [int(r * 255), int(g * 255), int(b * 255)]
|
||||||
|
|
||||||
def rgb_to_hsv(r, g, b):
|
def rgb_to_hsv(r, g, b):
|
||||||
return colorsys.rgb_to_hsv(r/255,g/255,b/255)
|
return colorsys.rgb_to_hsv(r/255,g/255,b/255)
|
||||||
|
|
Loading…
Reference in a new issue