aboutsummaryrefslogtreecommitdiff
path: root/pixelevents/DecayEvent.py
diff options
context:
space:
mode:
Diffstat (limited to 'pixelevents/DecayEvent.py')
-rw-r--r--pixelevents/DecayEvent.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pixelevents/DecayEvent.py b/pixelevents/DecayEvent.py
index c9fc226..01255be 100644
--- a/pixelevents/DecayEvent.py
+++ b/pixelevents/DecayEvent.py
@@ -1,4 +1,4 @@
-from pixelcore import PixelEvent
+from operationscore.PixelEvent import *
import Util, math
class DecayEvent(PixelEvent):
def initEvent(self):
@@ -9,4 +9,9 @@ class DecayEvent(PixelEvent):
decay = math.exp(timeDelay*-1*self['Coefficient'])
if self['DecayType'] == 'Proportional':
decay = float(self['Coefficient']) / timeDelay
- return Util.multiplyColor(self['Color'], decay)
+ color = Util.multiplyColor(self['Color'], decay)
+ return color if sum(color) > 5 else None
+ @staticmethod
+ def generate(decayType, coefficient, color):
+ args = {'DecayType': decayType, 'Coefficient':coefficient, 'Color':color}
+ return DecayEvent(args)