Registry / utility / color-hex

color-hex

JSON →
library0.2.0rscratesunverified

Procedural macro for converting hexadecimal strings to an RGB or RGBA byte array at compile time.

# Cargo.toml [dependencies] color-hex = "0.2.0"
INSTALL
IMPORT
SIG · COLOR-HEX
C
color-hex
utilityrustv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

color_hex
use color_hex::color_hex;

Convert a hex color string to an RGB byte array at compile time.

use color_hex::color_hex; fn main() { let rgb: [u8; 3] = color_hex!("#ff0000"); assert_eq!(rgb, [255, 0, 0]); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
color-hex — cargo add color-hex · libregistry