How to use the Color Picker & Palette Generator
- Click the color box or type a 6-digit HEX code to choose your base color.
- Fine-tune your color using the Hue, Saturation, and Lightness sliders.
- Check the WCAG accessibility cards to ensure your text meets AA and AAA readability guidelines.
- Click any swatch in the shades or harmonies strip to inspect it or copy its color value.
Understanding Color Models: HEX, RGB, and HSL
Modern web browsers and digital design applications (like Figma, Sketch, and Adobe Illustrator) utilize several primary mathematical color representations to define pixels on digital displays:
| Color Model | Structure | Best Used For |
|---|---|---|
| HEX (Hexadecimal) | #RRGGBB (base-16 numbers from 00 to FF) |
CSS stylesheets, design system specs, and quick copy-paste sharing. |
| RGB (Red, Green, Blue) | rgb(0–255, 0–255, 0–255) |
Hardware displays, canvas pixel manipulations, and alpha blending (rgba). |
| HSL (Hue, Saturation, Lightness) | hsl(0–360°, 0–100%, 0–100%) |
Generating tints, shades, hover states, and dynamic design themes programmatically. |
Harmonious Palette Generation
Color theory provides geometric relationships on the traditional 360-degree color wheel that produce naturally pleasing aesthetics:
- Complementary: Colors located exactly opposite each other on the color wheel ((180^circ) apart). Provides maximum visual contrast for primary CTA buttons.
- Analogous: Hues adjacent on the wheel ((pm 30^circ)). Creates serene, comfortable, cohesive design palettes often found in nature.
- Triadic: Three colors spaced evenly around the wheel ((120^circ) apart). Vibrant and balanced, ideal for illustrative UI branding.
WCAG 2.1 Color Contrast Standards
The Web Content Accessibility Guidelines (WCAG 2.1) specify minimum contrast ratios between foreground text and its background to ensure readability for users with low vision or color blindness:
- Level AA (Minimum Contrast): Requires a contrast ratio of at least 4.5:1 for normal body text (under 18pt or 24px) and 3.0:1 for large text (18pt+ or bold 14pt+).
- Level AAA (Enhanced Contrast): Requires a contrast ratio of at least 7.0:1 for normal text and 4.5:1 for large text.
- UI Components & Icons: Graphical elements and active user interface components require a minimum 3.0:1 ratio against adjacent background colors.
Formulas for Relative Luminance & Contrast Ratio
Contrast ratios are computed using relative luminance ((L)), normalized between 0 (darkest black) and 1 (lightest white):
Contrast Ratio = (L1 + 0.05) / (L2 + 0.05)
Where (L1) is the relative luminance of the lighter color and (L2) is the relative luminance of the darker color. The resulting ratio ranges from 1:1 (identical colors with zero contrast) to 21:1 (pure black against pure white).
The Evolution to Wide-Gamut P3 and OKLCH in Modern CSS
For nearly three decades, web development was constrained to the sRGB color space—a limited gamut standard established in 1996 for CRT monitors. Modern smartphones, laptops (such as Apple Retina displays), and HDR televisions can display up to 50% more colors than standard sRGB using the Display P3 wide-gamut profile.
With CSS Color Module Level 4, browsers now natively support OKLCH (oklch(lightness chroma hue)). Unlike legacy HSL, where a yellow at 50% lightness looks blindingly bright while a blue at 50% lightness looks dark, OKLCH is perceptually uniform. Adjusting the hue in OKLCH guarantees that perceived lightness remains constant, making it dramatically easier for UI designers to generate accessible dark mode themes, consistent hover states, and dynamic status badges.
Building a Complete UI Color System from a Single Seed
A robust enterprise design system (like Material Design or Tailwind CSS) expands a single brand seed color into a 10-shade numerical scale (from 50 to 950):
- 50–100 (Background Tints): Very soft, desaturated tints used for card backgrounds, alert message backings, and subtle table zebra striping.
- 200–300 (Subtle Borders & Dividers): Low-contrast shades designed for input outlines, modal dividers, and separator borders.
- 500–600 (Primary Brand Elements): High-saturation midtones used for primary interactive buttons, navigation links, and focus rings.
- 700–800 (Hover & Active States): Darkened shades triggered on mouse hover, keyboard focus, and pressed button states to provide immediate tactical feedback.
- 900–950 (High-Contrast Text): Deep, saturated dark values used for text on tinted backgrounds to ensure WCAG AAA accessibility.
Frequently asked questions
How does HSL make it easier to create button hover states?
What contrast ratio is required to pass WCAG AA for normal body text?
Can I copy the color in multiple CSS formats?
Does this color picker run offline and respect privacy?
Last reviewed November 2026. Results are estimates for information only — see our disclaimer.