Color Picker & Converter

Pick a color and instantly get its HEX, RGB, and HSL values, along with a matching palette built from actual color theory.

Three Ways of Describing the Exact Same Color

A single color can be written in several completely different-looking formats, and none of them is more "correct" than the others — HEX, RGB, and HSL are just three different coordinate systems pointing at the same point in color space. Which one you reach for usually depends on what you're actually trying to do with it.

HEX is compact and ubiquitous in CSS and design tools. RGB describes color the way screens actually produce it — by mixing red, green, and blue light. HSL describes color the way people intuitively think about it — a hue (the base color), how saturated or muted it is, and how light or dark it is. Converting between them isn't just a technical exercise; it's often the fastest way to make a color intuitively adjustable (via HSL) before locking it into the format your code actually needs (HEX or RGB).

At a glance:
• HEX packs red, green, and blue into a 6-digit base-16 code
• RGB expresses the same three channels as plain 0–255 numbers
• HSL separates hue, saturation, and lightness — the most intuitive format for adjusting a color by feel
• All three formats can represent the exact same 16.7 million colors

Color Picker & Converter

Hue Position on the Color Wheel

HEX

#0284C7

RGB

rgb(2, 132, 199)

HSL

hsl(199, 98%, 39%)

Generated Palette

How HEX, RGB, and HSL Actually Convert

HEX to RGB:

Each pair of hex digits (base 16) converts directly to a 0–255 value

Worked Example

Given: #0284C7

Step 1: Split into three pairs → 02, 84, C7
Step 2: Convert each pair from base 16 to base 10 → 02 = 2, 84 = 132, C7 = 199
Step 3: Result → rgb(2, 132, 199) — the exact same color, different notation

Getting to HSL Takes a Bit More Math

HSL isn't a simple digit-for-digit swap. It's calculated by finding the highest and lowest of the three RGB values (which determine lightness and saturation) and then figuring out where on a 360-degree color wheel the dominant channel sits (which determines hue). That's why the color wheel above is a genuinely useful way to picture HSL — the hue value is quite literally an angle on that circle.

Contrast Isn't Optional — It's a Standard

Choosing colors for text and backgrounds isn't purely aesthetic — accessibility guidelines set specific minimum contrast ratios to keep content readable for people with low vision.

WCAG Contrast Requirements

Content Type AA Minimum AAA Minimum
Normal text 4.5 : 1 7 : 1
Large text (18pt+) 3 : 1 4.5 : 1
UI components / icons 3 : 1 Not specified

These figures come from the Web Content Accessibility Guidelines (WCAG) 2.x standard, widely used as the baseline for web accessibility compliance.

Where Color Format Actually Matters

Web & UI Design: CSS accepts HEX, RGB, and HSL interchangeably, but designers often prototype in HSL specifically because sliding just the lightness or saturation value produces predictable, intuitive tints and shades of the same base hue.

Brand Consistency Across Formats: A brand's exact color needs to translate consistently across a website (HEX/RGB), print materials (CMYK), and sometimes fabric or packaging (Pantone), which is why style guides often list multiple equivalent color codes for the same brand color.

Accessibility Compliance: Legal and ethical accessibility standards require sufficient contrast between text and background colors, making contrast ratio calculation a standard step in any serious design or development workflow.

Data Visualization: Choosing a color palette for charts and graphs often relies on HSL specifically, since evenly spacing hues around the color wheel is the most reliable way to generate a set of colors that are visually distinct from one another.

Print vs. Screen Color Matching: Colors that look accurate on an RGB screen can shift noticeably once converted to CMYK for printing, since the two systems mix color in fundamentally different ways (light vs. ink) — a frequent source of "why doesn't this look right printed" frustration.

Theming & Dark Mode Design: Generating a coordinated light and dark theme often starts from HSL, since adjusting only the lightness value while keeping hue and saturation constant is a reliable way to build a matching dark variant of a color palette.

Working With Color Formats Efficiently

✓ Use HSL when you want to intuitively "nudge" a color: Wanting a slightly darker or more muted version of a color is a lightness or saturation tweak in HSL — the same adjustment in RGB or HEX requires recalculating all three channels by feel.

✓ Shorthand HEX only works for repeating digit pairs: #0284C7 can't be shortened, but a color like #FF0000 can be written as the shorthand #F00 — only because each pair happens to repeat the same digit.

✓ Alpha channel adds transparency, not a new color: RGBA and 8-digit HEX (#RRGGBBAA) add a fourth transparency value on top of the same RGB color — the color itself doesn't change, only how much of what's behind it shows through.

✓ Complementary colors sit directly across the wheel: A color's complement is exactly 180 degrees away in hue — useful for high-contrast accents, though often too intense for large areas of a design.

✓ Don't rely on color alone to convey meaning: Roughly 1 in 12 men have some form of color vision deficiency — pairing color with an icon, label, or pattern keeps information accessible regardless of how someone perceives color.

✓ Screen colors aren't guaranteed to print the same: If a design is headed to print, converting to CMYK early and checking the result avoids an unpleasant surprise when the physical version looks noticeably different from the screen.

Where These Color Formats Actually Came From

RGB's Roots in 19th-Century Physics: The idea that red, green, and blue light can combine to create any visible color traces back to trichromatic color theory, developed by physicists including James Clerk Maxwell in the mid-1800s, long before it became the basis for how every digital screen produces color today.

HEX Notation Arrived With the Early Web: Hexadecimal color codes became a defining feature of web design after HTML color specifications standardized them in the mid-1990s, largely because hex is a naturally compact way to represent the byte-sized 0–255 values RGB uses.

The "Web-Safe" Color Era: In the 1990s, when many computer displays could only reliably render 256 total colors, designers relied on a specific 216-color "web-safe" palette to avoid unpredictable color shifts across different monitors — a constraint that has since become obsolete as displays improved.

HSL Formalized a More Intuitive Model: While RGB reflects how screens physically produce color, HSL was developed and later adopted into CSS specifically because it maps more closely to how humans naturally describe color — by its base hue first, then how vivid and how light or dark it is.

Frequently Asked Questions

Q: Which color format should I actually use in my CSS?

All three work identically in modern browsers — HEX is the most compact and common for static colors, while HSL is often easier to work with when you need to programmatically generate lighter, darker, or more muted variations.

Q: What does the "alpha" value in RGBA or 8-digit HEX mean?

It controls transparency — 0 is fully transparent and 1 (or FF in hex) is fully opaque, with values in between blending the color with whatever is behind it.

Q: How do I check if my text has enough contrast against its background?

Calculate the contrast ratio between the two colors and compare it against WCAG's minimum thresholds — 4.5:1 for normal text is the standard baseline most accessibility audits check against.

Q: Why do my colors look different when printed compared to on screen?

Screens create color by emitting light (RGB), while printers create color by absorbing and reflecting light off ink on paper (CMYK) — the two systems have different achievable color ranges, so an exact visual match isn't always possible.

Q: What's the difference between complementary, analogous, and triadic palettes?

Complementary uses two colors directly opposite on the wheel for high contrast. Analogous uses colors sitting close together for a harmonious, low-contrast feel. Triadic uses three colors evenly spaced 120 degrees apart for a balanced but vibrant combination.

Q: Can two different HEX codes represent the exact same visible color?

No — every HEX code maps to exactly one specific RGB value, so two different codes always represent two genuinely different colors, even if the difference is too subtle to notice by eye.