| Crates.io | shortest-color |
| lib.rs | shortest-color |
| version | 0.1.2 |
| created_at | 2025-08-26 05:16:43.950351+00 |
| updated_at | 2025-09-17 06:28:40.897088+00 |
| description | Fastest color shortener |
| homepage | |
| repository | https://github.com/rostislavnagimov/shortest-color |
| max_upload_size | |
| id | 1810541 |
| size | 16,552 |
Ultra-fast CSS color parser - sub-200ns latency, under 5.5KB size
Performance: <200ns average, <5.5KB size, zero dependencies
Accepts hex, rgb/rgba, hsl/hsla, keywords
use shortest_color::shorten_css_color;
shorten_css_color("#ff0000") // "red"
shorten_css_color("rgb(0,0,255)") // "blue"
shorten_css_color("WHITE") // "#fff"
Install:
cargo add shortest-color
[dependencies]
shortest-color = "0.1.2"