Expand description
Generate random HSV/HSVA color values with configurable channel bounds.
The crate samples each component independently from the configured numeric ranges. It does not attempt palette design, gamut mapping, contrast checking, or perceptual-uniform sampling.
The formatted hsva(...) output is a stable crate compatibility format; it
is not intended to imply broad browser CSS support.
§Examples
use rand_hsv::random_hsv;
let color = random_hsv();
assert!((0.0..=360.0).contains(&color.hue));
assert!(color.to_hsva_string().starts_with("hsva("));Structs§
- HsvColor
- Represents a randomly generated
hsva()color value. - HsvRange
- User-provided HSV channel bounds for random generation.
Enums§
- HsvError
- Error returned when HSV bounds are invalid.
Functions§
- random_
hsv - Generates a random HSV color using default bounds.
- random_
hsv_ in - Generates a random HSV color using custom bounds.
- random_
hsv_ in_ with_ rng - Generates a random HSV color using custom bounds and a caller-provided RNG.
- random_
hsv_ with_ rng - Generates a random HSV color using default bounds and a caller-provided RNG.