Created
November 5, 2017 02:41
-
-
Save notjuliee/7bc4cd4df0f3359f0eb2f74e10332c63 to your computer and use it in GitHub Desktop.
Rainbow Scanner FX For Razer Keyboards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openrazer.client as rc | |
from time import sleep | |
devMan = rc.DeviceManager() | |
kb = devMan.devices[0] | |
print("Done opening keyboard") | |
colorPhase = 0 | |
color = [255, 0, 0] | |
def incrColor(): | |
global colorPhase | |
global color | |
while True: | |
if colorPhase == 0: | |
if color[0] > 0: | |
color[0] -= 1 | |
color[1] += 1 | |
return tuple(color) | |
colorPhase = 1 | |
if colorPhase == 1: | |
if color[1] > 0: | |
color[1] -= 1 | |
color[2] += 1 | |
return tuple(color) | |
colorPhase = 2 | |
if colorPhase == 2: | |
if color[2] > 0: | |
color[2] -= 1 | |
color[0] += 1 | |
return tuple(color) | |
colorPhase = 0 | |
while True: | |
for c in range(2, 19): | |
kb.fx.advanced.matrix.reset() | |
for r in range(0, 6): | |
nc = incrColor() | |
kb.fx.advanced.matrix[r, c] = nc | |
kb.fx.advanced.matrix[r, c-1] = nc | |
kb.fx.advanced.draw() | |
for c in range(17, 0, -1): | |
kb.fx.advanced.matrix.reset() | |
for r in range(0, 6): | |
nc = incrColor() | |
kb.fx.advanced.matrix[r, c] = nc | |
kb.fx.advanced.matrix[r, c-1] = nc | |
kb.fx.advanced.draw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment