Skip to content

Commit

Permalink
updated basic effects example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jath03 committed Feb 20, 2021
1 parent 6e048c4 commit 8550523
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/pages/effects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ for setting a device to a rainbow color.
.. code-block:: python
from openrgb import OpenRGBClient
from openrgb.utils import RGBColor
from openrgb.utils import RGBColor, ZoneType
cli = OpenRGBClient()
# dividing the color spectrum by number of LEDs
step = int(len(cli.ee_devices[0].colors)/360)
# finding a linear zone
zone = next(z for dev in cli.ee_devices for z in dev.zones if z.type == ZoneType.LINEAR)
# dividing the color spectrum by number of LEDs in the zone
step = int(360/len(zone.colors))
# Setting the zones colors to the entire spectrum of the rainbow
for i, hue in enumerate(range(0, 360, step)):
cli.ee_devices[0].colors[i] = RGBColor.fromHSV(hue, 100, 100)
cli.ee_devices[0].show()
zone.colors[i] = RGBColor.fromHSV(hue, 100, 100)
zone.show()

0 comments on commit 8550523

Please sign in to comment.