B10 (Base-4096) color encoding system for packing HEX into 2 characters
Project description
B10 Color Encoding (Base-4096)
clr_b10 is a high-density color encoding system designed to minimize data weight in text-based protocols. It allows for the packing of a standard 24-bit HEX color into exactly 2 characters using the custom B10 alphabet.
Key Features
- Ultra-Compression: Reduces string length for colors by 70% compared to HEX strings.
- 24-bit Support: Perfectly maps standard RGB/HEX colors without loss of precision.
- Cross-Platform: Fully compatible with the B10 JavaScript ecosystem.
Installation
pip install clr_b10
Usage
from clr_b10 import clr_b10
# Encoding HEX (#RRGGBB) to B10 (2 characters)
b10_color = clr_b10.from_hex("#FF5733")
print(b10_color) # Output: 2-character string
# Decoding B10 back to HEX
hex_color = clr_b10.to_hex(b10_color)
print(hex_color) # Output: #FF5733
# Converting B10 directly to RGB tuple
r, g, b = clr_b10.to_rgb(b10_color)
print(f"RGB: ({r}, {g}, {b})")
Technical Specification
The library uses a base-4096 (12-bit) numerical system. Since a standard color is 24 bits (8 bits each for Red, Green, and Blue), it is split into two 12-bit chunks, each represented by one character from the B10 alphabet.
Support
Contact: support.base.4096@gmail.com
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clr_b10-1.0.0.tar.gz.
File metadata
- Download URL: clr_b10-1.0.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a608fcdfdee82f34cb2e784a48464c5833f48fe59989e8ae8bed962b7bddc3d8
|
|
| MD5 |
1c7334f3d2831d7b5f9e8ad2c2366edd
|
|
| BLAKE2b-256 |
cff36c2b1fa50e50c4c7a65333cb86491ba65d614418f4174662c795fbe7c543
|
File details
Details for the file clr_b10-1.0.0-py3-none-any.whl.
File metadata
- Download URL: clr_b10-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a21992e80109d6a0064bcd8904183f6f208ce1faae50269eaa7c62ca1f03bdd4
|
|
| MD5 |
53d44f1bebdcf42f09e64254bdc2f9a4
|
|
| BLAKE2b-256 |
389d2d0cd160a3e146dfac140e2995f3ad5f95d14036f417a2942d5100bc9de0
|