Skip to main content

ChromaLib

Build Ruff

A typed library for Razer Chroma that supports effect layering, updates, and expiry while managing the connection with the Chroma SDK over a websocket, allowing you to focus on creating effects.

Installing

Python 3.11 to 3.15 is supported

pip install git+https://github.com/peterservices/ChromaLib.git

Simple Example

Example
import asyncio

from chromalib import (
    AppCategory,
    AppConfiguration,
    AuthorConfiguration,
    ChromaApp,
    Color,
    DeviceType,
    EffectMethod,
    KeyboardEffect,
    create_explosion_colors,
    generate_explosion_updater,
)

configuration = AppConfiguration(
    title="Red Integration",
    description="Sets all devices to red",
    author=AuthorConfiguration(
        name="YourName",
        contact="YourWebsite"
    ),
    supported_devices=[
        DeviceType.KEYBOARD
    ],
    category=AppCategory.APPLICATION,
    effect_id_hierarchy=[
        "background",
        "foreground"
    ] # Optional
)

app = ChromaApp(config=configuration)

async def main():
    await app.start()
    colors = [[Color(blue=1)] * 24] * 8 # 24 columns x 8 rows (Yes this is not optimal, will be improved later)
    app.add_effect(KeyboardEffect(
        colors=colors,
        method=EffectMethod.FILL,
        id="background"
    ))

    await asyncio.sleep(0.5)

    color = Color()
    color.RGB_int = (255, 0, 0) # Another way to specify color values
    app.add_effect(KeyboardEffect(
        colors=create_explosion_colors(color),
        method=EffectMethod.FILL_NON_ZERO,
        update=generate_explosion_updater(),
        update_rate_seconds=0.12,
        expires_after_updates=15,
        id="foreground"
    ))

    await asyncio.sleep(4)
    await app.stop()
asyncio.run(main())

Features

  • Supports all major device types
  • Supports custom effect update functions
  • Utilizes Pydantic models for easy type validation
  • Fully typed with docstrings
  • Asynchronous background loop

Metadata

Release files for chromalib 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chromalib 0.1.0
File Size Uploaded Provenance Actions
chromalib-0.1.0.tar.gz 10.6 kB With provenance Details for chromalib-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chromalib 0.1.0
File Interpreter ABI Platform Actions
chromalib-0.1.0-py3-none-any.whl Python 3 none any Details for chromalib-0.1.0-py3-none-any.whl

Total release size: 23.4 kB

Release files / chromalib-0.1.0.tar.gz

Download URL chromalib-0.1.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
784041f8fa80ab6de8d66e7137266228583c24882b94b68eefcac2aa714b28b9
BLAKE2b-256 checksum
How to use checksums
15364b9584652d29ad779775da36b39e200e7cebb8db07d2ef2c08a2b4b21351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / chromalib-0.1.0-py3-none-any.whl

Download URL chromalib-0.1.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64de79709b63bc7bdb4b3fd24b0f051b6e37df038eb6be66b1d4a740c5c9f1f8
BLAKE2b-256 checksum
How to use checksums
2e04595f804cd0bbeda6dda79232343303be116137b05bc3f8f55314f63ab11b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for chromalib 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chromalib-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page