Random Triadic Palette Generator
Generate 2 through 32 sRGB hex colors using the named hue harmony with derived lightness steps and injected randomness.
Description
Generate 2–32 triadic sRGB hex colors using an ordered hue arrangement and stepped lightness.
A triadic hue arrangement uses three positions spaced 120 degrees apart on a hue wheel. This generator selects one base hue, then follows those offsets in order, with lighter repeats when more colors are requested.
HSL expresses hue as an angle and saturation and lightness as percentages. CSS defines HSL in terms of sRGB; HSL lightness is not a perceptually uniform brightness scale.1
The output colors array contains copyable six-digit hex strings without alpha. These are candidate swatches; choosing usable text and background pairs requires an independent contrast check.
When to use Random Triadic Palette Generator
Use it to explore triadic swatches for an illustration, mockup, or design study, then evaluate them in the intended composition.
How to use Random Triadic Palette Generator and understand its results
- Enter integer count from 2 through 32. Choose at least 3 to include all base hue positions once.
- Run the generator and inspect colors in their returned order. Copy each #RRGGBB value into the intended design environment.
- Check text contrast and how the colors work together. Run again for another base or palette; no seed field is exposed.
H_i = 360 × rH + offsets[i mod 3]; offsets = [0, 120, 240] Hue is wrapped to [0, 360) during conversion.
S = 55 + 35 × rS; L_i = min(85, 42 + 16 × rL + 8 × floor(i/3)) Indices start at zero. Exactly three random draws establish base hue, shared saturation, and base lightness for the whole palette.
The converter calculates HSL chroma, maps the hue sector to RGB, adds the lightness offset, and rounds each channel to an 8-bit value. It emits uppercase #RRGGBB strings in sequence order.
{
"input": {
"count": 3
},
"randomDraw": 0.25,
"output": {
"colors": [
"#75C02B",
"#2B75C0",
"#C02B75"
]
}
} Counts below 3 produce only the beginning of the hue sequence. Every completed offset cycle increases lightness by eight percentage points, capped at 85; sufficiently late colors can repeat. Count one and counts above 32 are rejected.
An injected random draw must be finite and within [0, 1). Invalid draws cause a tool error rather than being clamped to the range.
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.
The generator does not ensure accessibility contrast, perceptual separation, printing gamut, color-vision suitability, or a complete visual theme. Hex rounding can obscure small HSL differences.
Alternative or Complementary methods
Use another palette convention when its hue structure or style better fits the composition. Compare contrast separately before assigning swatches to text, background, or state indicators.
References
-
CSS Color Module Level 4: HSL and sRGB color representations — World Wide Web Consortium
Similar or alternative tools
- Related Palette Generator
Generate a different style or hue arrangement with an explicit count.
- Random Color Palette Generator
Sample a broader HSL style without the named arrangement.
- Color Contrast Ratio
Check the contrast ratio of chosen foreground and background swatches.