color_parser_lib

Crates.iocolor_parser_lib
lib.rscolor_parser_lib
version0.1.1
created_at2025-04-27 06:37:37.299275+00
updated_at2025-04-27 15:48:42.378874+00
descriptionA simple hex color parser that supports shorthand and alpha channels
homepage
repositoryhttps://github.com/Mr-Unforgettable/color_parser
max_upload_size
id1650847
size26,919
Abhinav Pratap Singh (Mr-Unforgettable)

documentation

README

Color Parser

A simple and lightweight Rust library to parse hex color codes.

Supports:

  • 3-digit shorthand (#FA3)
  • 4-digit shorthand with alpha (#FA3C)
  • Full hex (#FFAABB)
  • Full hex with alpha (#FFAABBCC)

Usage

use color_parser::parse_hex_color;

let color = parse_hex_color("#FFAABB").unwrap();
println!("{:?}", color); // Rgba { red: 255, green: 170, blue: 187, alpha: 255 }

Features

  • Support for RGBA values
  • Support for shorthand syntax
  • CLI support
  • Support for HSV, HSL, CMYL parsing
Commit count: 17

cargo fmt