1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # Overview
//!
//! Rust library for parsing CSS color string as defined in the W3C's [CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/).
//!
//! ## Supported Color Format
//!
//! * [Named colors](https://www.w3.org/TR/css-color-4/#named-colors)
//! * RGB hexadecimal (with and without `#` prefix)
//! + Short format `#rgb`
//! + Short format with alpha `#rgba`
//! + Long format `#rrggbb`
//! + Long format with alpha `#rrggbbaa`
//! * `rgb()` and `rgba()`
//! * `hsl()` and `hsla()`
//! * `gradient()`
//!
//! ### Example Color Format
//!
//! <details>
//! <summary>Click to expand!</summary>
//!
//! ```text
//! transparent
//! gold
//! rebeccapurple
//! lime
//! accent
//! accent_inactive
//! #0f0
//! #0f0f
//! #00ff00
//! #00ff00ff
//! rgb(0,255,0)
//! rgb(0% 100% 0%)
//! rgb(0 255 0 / 100%)
//! rgba(0,255,0,1)
//! hsl(120,100%,50%)
//! hsl(120deg 100% 50%)
//! hsl(-240 100% 50%)
//! hsl(-240deg 100% 50%)
//! hsl(0.3333turn 100% 50%)
//! hsl(133.333grad 100% 50%)
//! hsl(2.0944rad 100% 50%)
//! hsla(120,100%,50%,100%)
//! gradient(rgb(0, 255, 0), #0f0, to right)
//! ```
//! </details>
//!
//! ## Usage
//!
//! Add this to your `Cargo.toml`
//!
//! ```toml
//! colorparser_css = "0.1.0"
//! ```
//!
//! ## Default Feature
//!
//! * `named-colors`: Enables parsing from [named colors](https://www.w3.org/TR/css-color-4/#named-colors). Requires [`rustc-hash`](https://crates.io/crates/rustc-hash).
//! * `theme`: Enables to add custom theme.
//!
//! ## Optional Features
//!
//! * `serde`: Enables serializing (into HEX string) and deserializing (from any supported string color format) using [`serde`](https://serde.rs/) framework.
pub use Color;
pub use ColorValue;
pub use ColorspaceImpl;
pub use Hsla;
pub use NormalizedHsla;
pub use NormalizedRgba;
pub use Rgba;
pub use Rgba16;
pub use Error;
pub use ErrorKind;
pub use Result;
pub use Gradient;
pub use GradientCoordinates;
pub use parse;
pub use Solid;
pub use NAMED_COLORS;
pub use ;