Expand description
A lightweight color parsing and manipulation library.
This crate provides a simple Color type representing RGB/RGBA colors with 8-bit channels,
along with utilities for parsing hex color strings in various formats.
§Features
- Parse hex color strings in multiple formats (RGB, RGBA, RRGGBB, RRGGBBAA)
- Support for optional alpha channel
- Conversion to/from hex strings
- Optional integration with egui (via
eguifeature) - Optional property testing support (via
arbfeature) - Optional serialization support (via
serdefeature)
§Examples
use hyperchad_color::Color;
// Parse a hex color string
let color = Color::from_hex("#FF5733");
assert_eq!(color.r, 255);
assert_eq!(color.g, 87);
assert_eq!(color.b, 51);
// Use predefined constants
let black = Color::BLACK;
let white = Color::WHITE;
// Convert back to hex string
assert_eq!(color.to_string(), "#FF5733");Modules§
- arb
- Property testing support via proptest.
Macros§
- color_
from_ hex - Re-export of the
color_from_hex!macro from thecolor-hexcrate.
Structs§
- Color
- Represents an RGB or RGBA color with 8-bit channels.
Enums§
- Parse
HexError - Errors that can occur when parsing a hex color string.