Skip to main content

ChromaLib

license version pyversions

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 designing effects.

Installing

Python 3.11 to 3.15 is supported

pip install chromalib

Simple Example

Example
import asyncio

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

configuration = AppConfiguration(
    title="Red Integration",
    description="Keybopard effects on a red background",
    author=AuthorConfiguration(
        name="YourName",
        contact="YourWebsite"
    ),
    supported_devices=[
        DeviceType.KEYBOARD
    ],
    category=AppCategory.APPLICATION,

    # Optional
    effect_id_hierarchy=[
        "background",
        "foreground"
    ]
)

app = ChromaApp(config=configuration)

async def main():
    await app.start()

    color = Color(blue=1) # One way to specify color values
    app.add_effect(KeyboardEffect(
        colors=create_static_colors(DeviceType.KEYBOARD, color),
        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(DeviceType.KEYBOARD, 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 Razer devices
  • Supports custom effect update functions
  • Utilizes Pydantic models for easy type validation
  • Fully typed with docstrings
  • Asynchronous background loop and functions
    • You must only modify active effects from the same event loop

Metadata

Release files for chromalib 0.2.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.2.0
File Size Uploaded Provenance Actions
chromalib-0.2.0.tar.gz 11.1 kB With provenance Details for chromalib-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 24.5 kB

Release files / chromalib-0.2.0.tar.gz

Download URL chromalib-0.2.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
53ae8657d2840bc6d71ab50ebcf3acdafa9653fcfea36f733a1cf60ad5a41866
BLAKE2b-256 checksum
How to use checksums
e55a546b9ab98bcf30a8af26b05d95ae388ab74d6b4159850a268414302a2cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","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 27, 2026.

Transparency log

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

Download URL chromalib-0.2.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86e2771e8cee84508dea7fcd9a00acc31b9d2c2c1e9b2e90a702f5c7719a7d41
BLAKE2b-256 checksum
How to use checksums
74897a5bb865114aae12d24335497ae61207d04caace2864e79f085266ace8db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","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 27, 2026.

Transparency log

Security for chromalib 0.2.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.2.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 27, 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.2.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