Skip to content

Commit

Permalink
Rebranding alternative control mode as effects control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jath03 committed Dec 2, 2020
1 parent c879397 commit bb215e8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Welcome to OpenRGB-Python's documentation!

pages/intro
pages/usage
pages/alternate
pages/effects
pages/advanced
pages/api

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ For creating custom effects, you often want to have your lights refreshing
quickly. Optimizing openrgb-python for speed isn't very hard if you know what
you are doing. The best way to maximize speed is to minimize OpenRGB SDK calls.
The most user-friendly way to do this is to use the
:doc:`alternative control</pages/alternate>` method, but it is possible to do
:doc:`effects control flow</pages/effects>`, but it is possible to do
accomplish the same things with the other functions. One common argument that
will help is the :code:`fast` argument. In any of the color-changing functions
(:code:`set_color`, :code:`set_colors`, :code:`show`), if you pass in
Expand Down
27 changes: 22 additions & 5 deletions docs/pages/alternate.rst → docs/pages/effects.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
Alternative Usage
=================
Writing Custom Effects
======================
This method of setting colors was made to be similar (on the front end) to other
LED control libraries like FastLED or adafruit's Neopixel library. It was also
optimized better for speed, making it more suitable to creating custom effects
that require a fast refresh rate.

Basics
------
OpenRGB devices with a "direct" mode are the best to use with effects, because
in that mode they don't save colors to flash storage or have any flickering
problems at higher refresh rates. You can control only these devices by using
the :any:`OpenRGBClient.ee_devices` property instead of the
:any:`OpenRGBClient.devices` list.

.. code-block:: python
from openrgb import OpenRGBClient
cli = OpenRGBClient()
print(cli.devices)
print(cli.ee_devices)
FastLED-like Control Flow
-------------------------
This control method follows a pattern of setting color values, and then calling
a function to apply the changed values to the physical LEDs. Here is an example
for setting a device to a rainbow color.
Expand All @@ -19,7 +36,7 @@ for setting a device to a rainbow color.
cli = OpenRGBClient()
# dividing the color spectrum by number of LEDs
step = int(len(cli.devices[0].colors)/360)
step = int(len(cli.ee_devices[0].colors)/360)
for i, hue in enumerate(range(0, 360, step)):
cli.devices[0].colors[i] = RGBColor.fromHSV(hue, 100, 100)
cli.devices[0].show()
cli.ee_devices[0].colors[i] = RGBColor.fromHSV(hue, 100, 100)
cli.ee_devices[0].show()
4 changes: 2 additions & 2 deletions docs/pages/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ RGB values or HSV values.
.. note::

Already familiar with other LED control libraries like fastLED or adafruit's
neopixel library? The :doc:`alternative control</pages/alternate>` method
neopixel library? The :doc:`effects control flow</pages/effects>`
was made to be used in a similar way. Try it out and see which one you like
better!

Expand Down Expand Up @@ -88,7 +88,7 @@ motherboard has 8 LEDs, and sets them in a red, blue, red, blue... pattern.
While these methods can be used for things like custom effects, it requires
a little more effort to make it work quickly enough (see
:doc:`optimizing for speed</pages/advanced>`). The
:doc:`alternative control</pages/alternate>` method was made to be easier
:doc:`effects control flow</pages/effects>` was made to be easier
to use for effects that require fast changes.


Expand Down

0 comments on commit bb215e8

Please sign in to comment.