Skip to main content

Crate rand_lab

Crate rand_lab 

Source
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.