Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

razer_chroma_keyboard-0.0.1.post2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file razer_chroma_keyboard-0.0.1.post2.tar.gz.

File metadata

File hashes

Hashes for razer_chroma_keyboard-0.0.1.post2.tar.gz
Algorithm Hash digest
SHA256 6a7c028f3a7d26f9120851e003280694a4340b722dc4eb5e94d9497eff2f3770
MD5 631944c604baff7a2b4130f1b2359597
BLAKE2b-256 4f3bc6f0c21ba422815300864068d2f8bb5a28f1ae1746a72ddd8721a88cc374

See more details on using hashes here.

File details

Details for the file razer_chroma_keyboard-0.0.1.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for razer_chroma_keyboard-0.0.1.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 ac18486be81e532de806b6a745e022ba4007e78e32a0724f47230b7ecb034da2
MD5 24e409960a934f17577542c876964a84
BLAKE2b-256 b9afd9cc874f6e7b2bb0f2dcfeef3734ff821925feae016e90dcfe5e0c252976

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page