Color Palette Generator

Create perfect chromatic harmonies for your design projects

High Contrast (Accessibility)

Colors optimized for maximum readability and vibrancy over the base color, ideal for text and Call to Action (CTA) buttons.

Complementary

Inverse

Analogous

Triadic

Split Complementary

Tetradic

Monochromatic

Master Guide: Color Theory, Harmonies, and Web Accessibility

Welcome to the ultimate tool for UI/UX designers and developers. This Color Palette Generator doesn't pick hues at random; it uses precise mathematical models based on traditional and modern color theory to calculate aesthetically perfect combinations from a single HEX code. Whether you're designing a brand's corporate identity, a mobile app, or a digital illustration, mastering color harmonies is the first step toward professional design.

The Mathematics of the Color Wheel (HSL Model)

To understand how our tool generates these colors, we must look behind the screen. In digital design, colors are often calculated using the cylindrical HSL model (Hue, Saturation, Lightness). The "Hue" is represented as an angle on a circle, going from $0^\circ$ to $360^\circ$.

By locking the Saturation and Lightness of your base color, the tool applies angular shifts to find the perfect harmonies. For instance, the calculation to find a strict complementary color is a simple diametrically opposite shift on the wheel. If your base color is $H_{base}$, the complement is calculated like this:

$$H_{comp} = (H_{base} + 180) \pmod{360}$$

Similarly, a triadic palette divides the circle into three equal parts, adding $120^\circ$ and $240^\circ$ to the base hue. These algorithmic calculations ensure that the generated colors maintain an unbreakable geometric relationship, which the human eye instinctively perceives as pleasant and harmonious.

Analysis of Color Harmonies (The Models)

  • High Contrast (Accessibility): Not strictly an artistic harmony, but a technical one. It generates opposing hues with drastic differences in Lightness. Ideal for buttons, error notifications, and text that must be read over vibrant backgrounds without straining the eyes.
  • Complementary: Colors located on opposite sides of the wheel. They create maximum contrast and visual tension. Use them with caution, preferably assigning one color as the main background and its complement only for small accents or highlighted icons.
  • Analogous: Neighboring colors on the color wheel (usually $30^\circ$ apart). They are the most commonly found in nature and are extremely pleasing and relaxing to the eye. Perfect for serene corporate designs or healthcare websites.
  • Triadic: Three equidistant colors. They offer high visual contrast just like complementary colors, but retain greater balance and color richness. It's the favorite scheme for children's apps and brands looking to convey energy and dynamism.
  • Monochromatic: The pinnacle of elegance. They use a single Hue but drastically alter its Saturation and Lightness. They result in clean, modern, distraction-free interfaces, highly popular in administration dashboard design and Dark Mode.

Web Accessibility and the WCAG 2.1 Standard

A beautiful design is useless if the user can't read it. The Web Content Accessibility Guidelines (WCAG) require normal text to have a minimum contrast ratio of 4.5:1 with its background (Level AA) or 7:1 (Level AAA).

To calculate this ratio accurately, we cannot use the RGB values directly. First, we must convert each normalized sRGB channel (from 0.0 to 1.0) to linear light ($C$) by undoing the gamma correction of screens. The exact W3C formulas are:

For dark values ($C_{sRGB} \le 0.04045$):

$$C = \frac{C_{sRGB}}{12.92}$$

For light values ($C_{sRGB} > 0.04045$):

$$C = \left(\frac{C_{sRGB} + 0.055}{1.055}\right)^{2.4}$$

Once the linear channels ($R$, $G$, $B$) are obtained, we calculate the relative luminance ($L$). Notice how the formula gives much more weight to green, since the human eye is more sensitive to that spectrum:

$$L = 0.2126R + 0.7152G + 0.0722B$$

Finally, the contrast ratio formula ($CR$) compares the luminance of the lighter color ($L_{claro}$) with the darker one ($L_{oscuro}$):

$$CR = \frac{L_{claro} + 0.05}{L_{oscuro} + 0.05}$$

Our "High Contrast" palette executes exactly these algorithmic calculations in real-time to suggest combinations that pass strict web accessibility audits.

The Golden Rule of Design: 60-30-10

Copying 5 colors from this generator and distributing them equally (20% each) across your web page is a fatal design mistake. To achieve a professional look, experts apply the 60-30-10 interior design rule adapted for the web:

  • 60% - Main Color: Usually the neutral background (a very light gray, white, or an extremely dark monochromatic hue). It is the canvas of your design.
  • 30% - Secondary Color: Your brand's base color. Used for navigation bars, cards, footers, or large headlines. Provides visual interest.
  • 10% - Accent Color: This is where the "Complementary Color" or the "High Contrast" color comes in. It is strictly reserved for purchase buttons (Call to Action), alert icons, or hyperlinks. It's the spice that makes the design pop.

Frequently Asked Questions (FAQ)

How do I copy a color to use it in CSS or Figma?

Simply click on the color box in any of the generated palettes. The HEX code will automatically be copied to your clipboard, ready to be pasted into your CSS stylesheet, Figma, Photoshop, or Illustrator.

Why does the High Contrast palette look different from the complementary ones?

A complementary color (opposite on the wheel) does not guarantee accessible reading. If you put pure red and pure green together (complementaries), they will vibrate and cause visual fatigue because they have similar lightness. The High Contrast palette algorithmically adjusts the Lightness in addition to the Hue to ensure text pops cleanly against the background.

What is the difference between Triadic and Tetradic?

The Triadic palette uses three equidistant colors. The Tetradic (also called double complementary) uses four colors, formed by two pairs of complementary colors joined in a rectangle within the wheel. It is the richest palette, but the hardest to balance in web design without looking like a chaotic rainbow.