Skip to main content

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

Cite: https://base-4096.vercel.app/

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

clr_b10-1.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clr_b10-1.0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file clr_b10-1.0.1.tar.gz.

File metadata

  • Download URL: clr_b10-1.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for clr_b10-1.0.1.tar.gz
Algorithm Hash digest
SHA256 fec2c4470935d9267f829b8fc2e75ae0d804c467a6d4b86e39f209355f9a6589
MD5 79eda569c6f667e84d8ef38e24b529c6
BLAKE2b-256 e189b857b6505546f6b4a45838893ee33f9070786c6b7612803e2113853590ef

See more details on using hashes here.

File details

Details for the file clr_b10-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: clr_b10-1.0.1-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

Hashes for clr_b10-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ca23078b1453b8ff113337c7903feb423514d47c612a20b53b8b982b4bfc44e
MD5 1232fd55872dc1461b702c577f3f49b3
BLAKE2b-256 97aefc414b31fd10e1d755af8cafcefa242e040ba11cc2516029c3230c96e710

See more details on using hashes here.

Supported by

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