Color Palette Generator with 60-30-10 Rule
Generate harmonious UI color palettes using the 60-30-10 design rule. Derives secondary and accent colors from contrast ratios, not random values.
About
The 60-30-10 rule is a spatial distribution principle borrowed from interior design and applied to interface composition. 60% of visible area uses the dominant (primary) color, 30% uses a secondary, and 10% uses an accent. Violating these proportions produces visual fatigue or flat, unreadable layouts. This tool derives secondary and accent colors algorithmically from a single primary input. It rotates hue on the HSL wheel - secondary at 180° (complementary), accent at 120° (triadic) - then adjusts saturation and lightness to maintain a WCAG contrast ratio above 4.5:1 between text and background. The foreground color for each swatch is computed from relative luminance L, not guessed.
Limitation: this generator assumes an sRGB gamut. Wide-gamut displays (P3) may render colors slightly differently. The derived palette is a starting point. Real products require testing against actual content density and imagery.
Formulas
Relative luminance of a color determines whether black or white text is readable against it. The formula linearizes each sRGB channel then applies perceptual weighting coefficients.
Where each linearized channel Clin is computed from the sRGB value CsRGB (0 - 1 range):
The contrast ratio between two luminances:
Where L1 is the lighter luminance and L2 is the darker. A ratio ≥ 4.5 satisfies WCAG AA for normal text. Secondary hue is derived as Hsec = (Hpri + 180) mod 360. Accent hue is Hacc = (Hpri + 120) mod 360.
Where L = relative luminance, Rlin, Glin, Blin = linearized sRGB channels, CR = contrast ratio, Hpri = primary hue in degrees, Hsec = secondary hue, Hacc = accent hue.
Reference Data
| Harmony Type | Hue Rotation | Use Case | Typical Contrast | Energy Level |
|---|---|---|---|---|
| Complementary | 180° | High-impact CTAs, hero sections | High | Bold |
| Triadic | 120° / 240° | Balanced dashboards, cards | Medium-High | Vibrant |
| Analogous | 30° / 330° | Calm reading interfaces | Low | Soothing |
| Split-Complementary | 150° / 210° | Versatile UI, less tension than complementary | Medium | Moderate |
| Tetradic (Rectangle) | 90° / 180° / 270° | Complex data-heavy layouts | Variable | Rich |
| Monochromatic | 0° (lightness shift) | Minimalist, editorial | Low | Subtle |
| 60-30-10 Distribution | N/A | General UI composition | Enforced by rule | Balanced |
| WCAG AA Text | N/A | Body text on backgrounds | ≥ 4.5:1 | N/A |
| WCAG AA Large Text | N/A | Headings ≥ 18pt | ≥ 3:1 | N/A |
| WCAG AAA Text | N/A | Enhanced accessibility | ≥ 7:1 | N/A |
| Relative Luminance (Red) | N/A | sRGB coefficient | 0.2126 | N/A |
| Relative Luminance (Green) | N/A | sRGB coefficient | 0.7152 | N/A |
| Relative Luminance (Blue) | N/A | sRGB coefficient | 0.0722 | N/A |
| sRGB Linearization Threshold | N/A | Channel value ≤ 0.03928 | Divide by 12.92 | N/A |
| sRGB Gamma | N/A | Channel value > 0.03928 | Power 2.4 | N/A |