A Rust library for parsing, serializing, and operating on hex colors.
![Build Status] ![Latest Version]
Module documentation with examples. The module documentation also includes a comprehensive description of the syntax supported for parsing hex colors.
Add this to your Cargo.toml
:
toml
[dependencies]
hex_color = "1.0"
Here's a simple example that matches a hex color and prints the value of the red, green, and blue components:
```rust use hex_color::HexColor;
fn main() { let s = "#789ABC"; let color: HexColor = s.parse(); println!("rgb({}, {}, {})", color.r, color.g, color.b); } ```
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.