-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy pathexample_py_script.py
More file actions
37 lines (30 loc) · 1.55 KB
/
example_py_script.py
File metadata and controls
37 lines (30 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import clr
clr.AddReference("Aurora")
clr.AddReference("System.Drawing")
from Aurora import Global
from Aurora.Settings import KeySequence, IEffectScript, VariableRegistry
from Aurora.Devices import DeviceKeys
from Aurora.EffectsEngine import EffectLayer
from Aurora.Utils import RealColor
from System.Drawing import Color
import System
array_device_keys = System.Array[DeviceKeys]
class ExamplePyEffect(IEffectScript):
ID = "ExamplePyEffect"
prop = None
ForegroundColour = Color.Red
BackgroundColour = Color.Black
DefaultKeys = KeySequence(array_device_keys((DeviceKeys.TAB, DeviceKeys.Q, DeviceKeys.W, DeviceKeys.E, DeviceKeys.R, DeviceKeys.T, DeviceKeys.Y, DeviceKeys.U, DeviceKeys.I, DeviceKeys.O, DeviceKeys.P)))
def __init__(self):
self.ForegroundColour = Color.Green
def get_Properties(self):
if self.prop == None:
self.prop = VariableRegistry()
self.prop.Register("keys", KeySequence(self.DefaultKeys), "Main Keys")
self.prop.Register("foregroundColour", RealColor(Color.Red), "Foreground Colour");
self.prop.Register("backgroundColour", RealColor(Color.Black), "Background Colour");
return self.prop
def UpdateLights(self, settings, state):
layer = EffectLayer(self.ID)
layer.PercentEffect(settings.GetVariable[RealColor]("foregroundColour").GetDrawingColor(), settings.GetVariable[RealColor]("backgroundColour").GetDrawingColor(), settings.GetVariable[KeySequence]("keys"), System.DateTime.Now.Second, 60)
return layer