Razer chroma compatible keyboard backlight driving library.
Project description
What is this library ?
This library allows a python application or script to change the keys backlight colors of a razer chroma compatible keyboard. A demo is also available.
How to install ?
Install https://www.razer.com/fr-fr/synapse-3.
Create an environment and activate it if you want to (optionnal).
Execute pip install razer-chroma-keyboard
How to test ?
Execute python -m razer_chroma_keyboard
. You should see promptly (in less than 3 seconds) the result on your keyboard.
How to use as a library ?
Import with import razer_chroma_keyboard
. For this example, also import time
.
Prepare your (R, G, B) color tuples matrix. So you know the dimensions, you can use this black matrix and modify it : m = [[(0, 0, 0) for _ in range(22)] for _ in range(6)]
.
Then you can use a with statement (to allow fine control of the connection) like this :
with razer_chroma_keyboard.razerServerChromaConnection() as connection :
connection.apply_chroma_custom(m)
while True: time.sleep(1)
The second line is because, when the with statement is left, the connection will be stopped, and the keyboard will back to it's previous state after a moment (if another software controls it). Example of full code to turn the whole keyboard into a specific color :
import razer_chroma_keyboard
import time
def change_color(color: tuple[int, int, int] = (50, 50, 50)):
m = [[color for _ in range(22)] for _ in range(6)]
with razer_chroma_keyboard.razerServerChromaConnection() as connection :
connection.apply_chroma_custom(m)
while True: time.sleep(1)
change_color((255, 191, 0)) # Amber yellow.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file razer_chroma_keyboard-0.0.1.post2.tar.gz
.
File metadata
- Download URL: razer_chroma_keyboard-0.0.1.post2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a7c028f3a7d26f9120851e003280694a4340b722dc4eb5e94d9497eff2f3770 |
|
MD5 | 631944c604baff7a2b4130f1b2359597 |
|
BLAKE2b-256 | 4f3bc6f0c21ba422815300864068d2f8bb5a28f1ae1746a72ddd8721a88cc374 |
File details
Details for the file razer_chroma_keyboard-0.0.1.post2-py3-none-any.whl
.
File metadata
- Download URL: razer_chroma_keyboard-0.0.1.post2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac18486be81e532de806b6a745e022ba4007e78e32a0724f47230b7ecb034da2 |
|
MD5 | 24e409960a934f17577542c876964a84 |
|
BLAKE2b-256 | b9afd9cc874f6e7b2bb0f2dcfeef3734ff821925feae016e90dcfe5e0c252976 |