Expand description
Generate random CIELAB color values with configurable component 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.
§Examples
use rand_lab::random_lab;
let color = random_lab();
assert!((0.0..=100.0).contains(&color.lightness));
assert!(color.to_lab_string().starts_with("lab("));Structs§
- LabColor
- Represents a randomly generated CIELAB
lab()color value. - LabRange
- User-provided CIELAB component bounds for random generation.
Enums§
- LabError
- Error returned when CIELAB bounds are invalid.
Functions§
- random_
lab - Generates a random CIELAB color using default bounds.
- random_
lab_ in - Generates a random CIELAB color using custom bounds.
- random_
lab_ in_ with_ rng - Generates a random CIELAB color using custom bounds and a caller-provided RNG.
- random_
lab_ with_ rng - Generates a random CIELAB color using default bounds and a caller-provided RNG.