color_parser_lib 0.1.1

A simple hex color parser that supports shorthand and alpha channels
Documentation
  • Coverage
  • 100%
    27 out of 27 items documented5 out of 10 items with examples
  • Size
  • Source code size: 26.42 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.29 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Mr-Unforgettable/color_parser
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Mr-Unforgettable

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