clr-b10
v1.0.2
Published
Base-4096 color encoding system (HEX to 2 characters)
Downloads
144
Readme
b10-clr
A specialized color compression utility that packs 24-bit HEX colors into exactly 2 characters using the B10 (Base-4096) alphabet.
Installation
npm i b10-clr
Usage
// Encode HEX to 2-character B10 string
const b10Color = clrB10.fromHex("#FF5733");
console.log(b10Color);
// Decode back to HEX
const hex = clrB10.toHex(b10Color);
console.log(hex); // #FF5733
// Get RGB components
const rgb = clrB10.toRGB(b10Color);
console.log(rgb); // [255, 87, 51]
Features
- 70% Compression: Reduces 7-character HEX strings to just 2 UTF-8 characters.
- Zero Loss: Perfect mapping of the 24-bit color space.
Cite: https://base-4096.vercel.app/
