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
//! Unified random color generation across supported color spaces.
//!
//! This umbrella crate re-exports the focused color-space crates from stable
//! modules. Use a focused crate such as `rand_rgb` when you only need one color
//! space, or use `rand_color` when you want one dependency for several spaces.
//!
//! Random values are sampled from numeric component ranges. They are not
//! gamut-checked, contrast-checked, or perceptually uniform.
//!
//! # Examples
//!
//! ```rust
//! let rgb = rand_color::rgb::random_color();
//! let hsl = rand_color::hsl::random_hsl();
//! let hsv = rand_color::hsv::random_hsv();
//!
//! assert!(rgb.to_rgba_string().starts_with("rgba("));
//! assert!(hsl.to_hsla_string().starts_with("hsla("));
//! assert!(hsv.to_hsva_string().starts_with("hsva("));
//! ```
/// RGB/RGBA random color generation from `rand_rgb`.
/// HSL/HSLA random color generation from `rand_hsl`.
/// HSV/HSVA random color generation from `rand_hsv`.
/// HWB/HWBA random color generation from `rand_hwb`.
/// Oklab random color generation from `rand_oklab`.
/// Oklch random color generation from `rand_oklch`.
/// CIELAB random color generation from `rand_lab`.
/// CIELCH random color generation from `rand_lch`.
/// RGB <-> HSL conversion helpers and traits from `rand_color_convert`.