TToolbox
🎭

Color Palette

Build palettes from a base color

About this tool

The Color Palette Generator is a design utility grounded in classical color harmony theory and modern UI design system architectures. Given any primary base color (HEX, RGB, HSL), it algorithmically derives complementary, analogous, triadic, split-complementary, and monochromatic palettes, while generating full 50-900 tonal shade steps ready for direct export into Tailwind CSS configurations and native CSS custom properties.

How to Use This Tool (Step-by-Step)

1

Pick or Paste Base Anchor Color

Select a hue using the color wheel or paste your brand hex code (e.g., #3B82F6).

2

Select Color Harmony Rule

Toggle between complementary contrast, serene analogous shades, or 10-step tonal luminance scales.

3

Verify Contrast & Export Tokens

Inspect text legibility across variations and copy CSS variables or tailwind.config theme blocks.

Color Wheel Harmonic Geometry

Rotates hue angles (180°, 120°, 60°) across perceptual color models to build aesthetically pleasing combinations.

10-Step Tonal Scale Synthesis

Synthesizes subtle background washes (50-100), borders (200-300), and dark hover/focus states (700-900).

Developer-First Export Formats

Export tokens in one click to JSON, CSS custom properties (--color-primary), or Tailwind CSS themes.

UI Palette & Color Scale Guidelines

  • •The 60-30-10 Composition Principle: Allocate approximately 60% of canvas area to neutral backgrounds, 30% to structural card elements, and reserve punchy accent colors for the remaining 10% (primary CTAs and badges).
  • •Avoid Naive Darkening in sRGB: Multiplying RGB channels by linear constants produces muddy, desaturated shadows (especially in yellows). Modern design systems rotate hue slightly towards cooler tints while decreasing luminance.
  • •Accessibility Contrast Thresholds: Always audit text placed over generated shades to verify compliance with WCAG 2.1 AA (4.5:1 for body copy).

Code & Transformation Examples

Base Color vs Harmonic Output

Anchor Brand Hex
#3B82F6 (Tailwind Blue)
Harmonic Palette Output
主色: #3B82F6 | 互补色: #F6AF3B | 类似色: #3BC7F6, #3B45F6

* Color-wheel rotation ensures mathematical harmony and prevents harsh perceptual dissonance.

Calculating Harmonies via HSL Rotation

Harmonic Math Function
function getHarmonies(h, s, l) {
  return {
    complementary: `hsl(${(h + 180) % 360}, ${s}%, ${l}%)`,
    analogousLeft: `hsl(${(h + 30) % 360}, ${s}%, ${l}%)`,
    analogousRight: `hsl(${(h - 30 + 360) % 360}, ${s}%, ${l}%)`
  };
}
Computed HSL Strings
// 输入: H:217, S:91%, L:60%
// 互补: hsl(37, 91%, 60%)
// 类似: hsl(247, 91%, 60%), hsl(187, 91%, 60%)

* Preserving saturation and luminance while stepping hue degrees yields cohesive UI accents.

Frequently Asked Questions

Q: What is a complementary color, and where should it be applied?

A: Complementary colors sit 180° opposite on the color wheel. Their extreme contrast makes them ideal for primary call-to-action buttons against calm backgrounds.

Q: What are the characteristics of analogous colors?

A: Analogous colors sit adjacent (30°-60°) on the color wheel. They share similar undertones, creating unified and serene compositions suitable for chart data series and card panels.

Q: Why do modern UI systems standardize on 50-900 tonal shade ladders?

A: It standardizes visual elevation: 50-100 for surface washes, 200-300 for borders, 500 for brand accents, 600-700 for hover/active states, and 800-900 for dark mode surfaces.

Related Tools

All processing happens locally in your browser. Your data is never uploaded to a server.
/