color_parser_lib 0.1.1

A simple hex color parser that supports shorthand and alpha channels
Documentation

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