Color Palette Generator

Generate a color palette online for free

Generated Palette

About the Color Palette Generator

This color palette generator builds harmonious color schemes from a single base color using the OKLCH color space — a perceptually uniform model where equal numeric steps produce equal visual differences. Pick a hue and chroma on the interactive color wheel, choose a harmony rule, and the tool generates a complete palette with every color in five formats: OKLCH, HSL, RGB, HEX, and Display P3.

All processing runs in your browser. No color data leaves your device, and the WebGL-powered wheel renders at 60 fps on your GPU.

What is Color Theory?

Color theory is the art and science of creating harmonious color combinations. It defines relationships between colors using geometric positions on a color wheel.

HueSaturationLightnessChromaHarmony

The OKLCH Color Space

OKLCH stands for OK Lightness, Chroma, Hue. Unlike HSL, equal numeric steps in OKLCH produce equal perceived color differences. A 30-degree hue shift near yellow looks the same as one near blue. This perceptual uniformity makes OKLCH ideal for generating palettes, because harmony rules based on fixed angle offsets produce visually balanced results.

Lightness
0 → 100
Chroma
0 → 0.4
Hue
0° → 360°
oklch(60% 0.15 250)

Color Harmony Rules

Each harmony rule defines a geometric pattern on the color wheel. The generator places your base color at one point and calculates companion colors at specific angular offsets. These relationships produce palettes that naturally look good together.

Analogous

±30° hue shifts. Adjacent colors that feel cohesive and natural.

Complementary

Opposite hues (+180°). Maximum contrast and visual tension.

Split Complementary

Two colors flanking the complement. Rich contrast, more nuanced.

Triadic

Three equidistant hues (120° apart). Vibrant and balanced.

Tetradic

Four hues forming a rectangle. Complex but well-rounded.

Monochromatic

Same hue, varied lightness. Elegant and unified.

Shades

Same hue and lightness, decreasing chroma. Subtle, sophisticated.

Heptadic

Seven evenly-spaced hues (51.4° apart). Maximum diversity.

Color Output Formats

One OKLCH source color converts to five output formats for maximum compatibility. Click the info button on any palette swatch to view all formats at once.

OKLCH

oklch(60% 0.15 250)

Native perceptual space. Modern CSS.

HSL

hsl(227, 58%, 42%)

Intuitive hue-based. Wide browser support.

RGB

rgb(45, 70, 170)

Screen standard. Direct pixel values.

HEX

#2d46aa

Compact notation. Universal web use.

Display P3

color(display-p3 ...)

Wide gamut. Vivid colors on modern screens.

WCAG

4.5:1 ratio

Check palette contrast against WCAG thresholds.

WCAG Contrast Accessibility

When building a color palette, contrast accessibility is essential. WCAG 2.1 defines minimum contrast ratios between foreground and background colors to ensure readability for all users. Use the HEX values from the color info dialog with a dedicated contrast checker to verify your palette meets the following thresholds:

AA (UI Components)

3:1

Minimum for icons, borders, focus indicators

AA (Normal Text)

4.5:1

Required for body text under 18px / 14px bold

AAA (Normal Text)

7:1

Enhanced readability for small text

AAA (Large Text)

4.5:1

Enhanced contrast for text ≥18px / ≥14px bold

How Does the WebGL Color Wheel Work?

The color wheel uses a GPU fragment shader to render over 400,000 OKLCH-to-RGB conversions per frame. Each pixel maps its polar position to an OKLCH value, converts through OKLab to linear RGB, applies gamut mapping, and encodes with the sRGB gamma transfer function. On displays that support Display P3, the shader maps to the wider gamut instead.

Vertex Shader

attribute vec4 aVertexPosition;
varying highp vec2 vTextureCoord;
void main() {
  gl_Position = aVertexPosition;
  vTextureCoord = (aVertexPosition.xy + 1.0) / 2.0;
}

Fragment Shader GPU

// Per-pixel: position → OKLCH → display color
float hue = degrees(atan(coord.y, coord.x));
float chroma = (dist / 0.5) * uMaxChroma;
vec3 linearRgb = oklabToLinearSrgb(vec3(L, a, b));

if (uIsP3 == 1)
  outputLinear = linearSrgbToLinearP3(linearRgb);

gl_FragColor = vec4(srgbGamma(out.rgb), 1.0);

How to Use the Color Palette Generator

  1. Click or drag on the color wheel to set your base hue and chroma. The angle determines the hue; the distance from center determines color intensity.
  2. Adjust the lightness slider to control how bright or dark the palette appears.
  3. Select a harmony rule from the dropdown (e.g., analogous, triadic, or complementary).
  4. View the generated palette below the wheel. Each swatch shows its OKLCH value.
  5. Hover over a swatch and click the copy button to copy the color value, or click the info button to view the color in all five formats.

Best Practices for Building Color Palettes

Common Use Cases

Key Takeaways

🎨

Perceptual Accuracy

OKLCH ensures equal numeric steps produce equal visual differences — no more HSL surprises.

8 Harmony Rules

From analogous to heptadic, geometric relationships on the wheel generate reliable palettes.

GPU Rendering

WebGL fragment shaders compute 422,500 color conversions per frame at 60fps.

Accessibility Ready

Five output formats make it easy to verify WCAG 2.1 contrast ratios with any checker.

Frequently Asked Questions

Is my color data safe when using this tool?

All color calculations happen in your browser using WebGL and JavaScript. No data is sent to any server. You can use this tool offline after the page loads.

What is the difference between OKLCH and HSL?

OKLCH is perceptually uniform: a 10-unit change in any axis looks the same regardless of the starting color. HSL is not — a 30-degree hue shift near yellow looks very different from one near blue. OKLCH produces more predictable and visually balanced palettes.

How do I check if my palette meets WCAG contrast requirements?

Click the info button on any swatch to view its HEX value, then use a contrast checker to compare foreground and background colors. WCAG 2.1 requires a minimum 4.5:1 contrast ratio for normal text and 3:1 for large text and UI components.

What is Display P3 and do I need it?

Display P3 is a wide color gamut that covers about 25% more colors than sRGB. Modern Apple devices and many newer monitors support it. If your audience uses these screens, P3 colors appear more vivid. The tool detects P3 support automatically.

Which harmony rule should I start with?

Analogous is the safest starting point — it produces naturally cohesive palettes. Complementary works well for designs that need strong contrast. Triadic suits bold, vibrant projects. Experiment with all eight rules to find the best fit for your design.

Related Tools

Use the Color Picker to extract colors from uploaded images, then refine them here as a base color. For photo editing, the Filters for Photos tool applies color adjustments directly to images. You can also convert images between formats or compress them for web use.