css-color
Parse color strings from CSS Color Module Level 4. All legacy sRGB forms are supported:
- RGB hexadecimal notations.
rgb()
andrgba()
functions.hsl()
andhsla()
functions.hwb()
function.- Named colors including the
transparent
keyword.
The none
keyword is supported. "Missing" color components behave identically to zero.
Usage
First, add this to your Cargo.toml
:
[]
= "0.2.8"
Example
use Srgb;
Supported Rust Versions
The minimum supported Rust version is 1.55. Earlier versions may compile but parsing can reject certain valid numeric values.
License
This repository is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributions
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.