Expand description
Generate random Oklab 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_oklab::random_oklab;
let color = random_oklab();
assert!((0.0..=1.0).contains(&color.lightness));
assert!(color.to_oklab_string().starts_with("oklab("));Structs§
- Oklab
Color - Represents a randomly generated
oklab()color value. - Oklab
Range - User-provided Oklab component bounds for random generation.
Enums§
- Oklab
Error - Error returned when Oklab bounds are invalid.
Functions§
- random_
oklab - Generates a random Oklab color using default bounds.
- random_
oklab_ in - Generates a random Oklab color using custom bounds.
- random_
oklab_ in_ with_ rng - Generates a random Oklab color using custom bounds and a caller-provided RNG.
- random_
oklab_ with_ rng - Generates a random Oklab color using default bounds and a caller-provided RNG.