Skip to main content

Crate rand_oklab

Crate rand_oklab 

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

OklabColor
Represents a randomly generated oklab() color value.
OklabRange
User-provided Oklab component bounds for random generation.

Enums§

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