Random HSV Color Generator
Choose uniformly from integer HSV tuples with hue 0–359 degrees and saturation/value 0–100 percent. Uses injected randomness and integer channel values.
Description
Choose one integer HSV tuple from a fixed coordinate grid.
HSV describes colors through hue, saturation, and value. Value differs from HSL lightness, so similarly named fields in the two models are not interchangeable.1
This generator returns hue from 0 through 359 degrees, saturationPercent from 0 through 100, and valuePercent from 0 through 100, all as integers. There is no formatted color string in the result.
When to use Random HSV Color Generator
Use it for HSV coordinate fixtures or color exploration where a discrete integer grid is intended.
How to use Random HSV Color Generator and understand its results
- Run with no input fields, or send {} programmatically.
- Read hue in degrees and saturationPercent and valuePercent as percentages.
- Convert the HSV tuple to RGB or another supported format before applying it in CSS; CSS has no native hsv() color function.
index = floor(randomDraw × 3672360) One finite draw in [0, 1) selects among 3,672,360 coordinate tuples.
last coordinate = index mod 101; saturationPercent = floor(index/101) mod 101; hue = floor(index/10201) Mixed-radix decomposition recovers the integer coordinates, with the last coordinate changing fastest.
Uniform randomness gives equal index weight to every tuple. Different tuples can describe the same visible color, so this is not a uniform distribution over perceived colors.
{
"input": {},
"randomDraw": 0.25,
"output": {
"hue": 90,
"saturationPercent": 0,
"valuePercent": 0
}
} Draw zero gives zero for every field. A draw immediately below one gives hue 359, both percentage coordinates 100. Invalid draws fail. Value zero gives black; saturation zero gives a neutral gray at the sampled value.
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 are no harmony, contrast, color-vision, alpha-compositing, or perceptual-uniformity guarantees.
Alternative or Complementary methods
Use HSL when CSS lightness coordinates are intended. RGB generation provides another representation without HSV conversion.
References
-
Color Gamut Transform Pairs (SIGGRAPH 1978) — Alvy Ray Smith
Similar or alternative tools
- Random HSL Color Generator
Generate HSL coordinates with lightness rather than HSV value.
- Random RGB Color Generator
Generate integer sRGB channels directly.