Random CIELCH Color Generator

Generate a CIELCH D50 tuple with lightness in [0, 100), chroma in [0, 150), and hue in [0, 360) using injected randomness; the tuple is not clipped to a device gamut.

Description

Sample CIELCH D50 lightness, chroma, and hue within fixed independent ranges.

CIELCH is the polar representation of CIELAB: chroma describes distance from the neutral axis and hue describes direction around it. CSS uses a D50 reference white for these coordinates.1

The output lightness ranges from zero toward 100, chroma from zero toward 150, and hue from zero toward 360 degrees. These sampled coordinates need not fit a device gamut.

When to use Random CIELCH Color Generator

Use it for CIE color-coordinate fixtures or studies where out-of-gamut coordinates are permitted.

How to use Random CIELCH Color Generator and understand its results

  1. Run without input fields, using {} programmatically.
  2. Read lightness on the 0–100 scale, chroma as a coordinate, and hue in degrees.
  3. Format the example as CSS lch(25% 37.5 90), or convert under the intended white-point and gamut convention before displaying it.
lightness = 100 × r1; chroma = 150 × r2; hue = 360 × r3

Three finite draws in [0, 1) independently select the coordinates.

The implementation returns numbers directly without converting from RGB, clipping to gamut, performing chromatic adaptation, or generating a CSS string. Coordinate-uniform sampling is not uniform over displayable colors.

json
{
  "input": {},
  "randomDraw": 0.25,
  "output": {
    "lightness": 25,
    "chroma": 37.5,
    "hue": 90
  }
}

Chroma zero makes hue irrelevant to the resulting neutral-axis coordinate. Upper bounds are approached by the sampling formulas but not intentionally included.

Floating-point rounding applies near endpoints. An invalid draw in any coordinate fails instead of being clamped.

Limitations and assumptions

The default source is Math.random; no seed input or cryptographic entropy guarantee is provided. Repeated runs may select the same result, and the distribution depends on the random source.

There is no device-gamut, accessibility, perceptual-spacing, printing, or palette-harmony guarantee. Lightness alone does not determine foreground/background contrast.

CIELCH is not OKLCH; their chroma scales and color-space definitions differ.

Alternative or Complementary methods

Choose the companion coordinate representation when needed, observing its conversion formulas. RGB generation provides directly bounded byte channels for another fixture convention.

References

  1. CSS Color Module Level 4 — World Wide Web Consortium

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies