1- Alternative Usage
2- =================
1+ Writing Custom Effects
2+ ======================
33This method of setting colors was made to be similar (on the front end) to other
44LED control libraries like FastLED or adafruit's Neopixel library. It was also
55optimized better for speed, making it more suitable to creating custom effects
66that require a fast refresh rate.
77
88Basics
99------
10+ OpenRGB devices with a "direct" mode are the best to use with effects, because
11+ in that mode they don't save colors to flash storage or have any flickering
12+ problems at higher refresh rates. You can control only these devices by using
13+ the :any: `OpenRGBClient.ee_devices ` property instead of the
14+ :any: `OpenRGBClient.devices ` list.
15+
16+ .. code-block :: python
17+
18+ from openrgb import OpenRGBClient
19+
20+ cli = OpenRGBClient()
21+
22+ print (cli.devices)
23+ print (cli.ee_devices)
24+
25+ FastLED-like Control Flow
26+ -------------------------
1027This control method follows a pattern of setting color values, and then calling
1128a function to apply the changed values to the physical LEDs. Here is an example
1229for setting a device to a rainbow color.
@@ -19,7 +36,7 @@ for setting a device to a rainbow color.
1936 cli = OpenRGBClient()
2037
2138 # dividing the color spectrum by number of LEDs
22- step = int (len (cli.devices [0 ].colors)/ 360 )
39+ step = int (len (cli.ee_devices [0 ].colors)/ 360 )
2340 for i, hue in enumerate (range (0 , 360 , step)):
24- cli.devices [0 ].colors[i] = RGBColor.fromHSV(hue, 100 , 100 )
25- cli.devices [0 ].show()
41+ cli.ee_devices [0 ].colors[i] = RGBColor.fromHSV(hue, 100 , 100 )
42+ cli.ee_devices [0 ].show()
0 commit comments