Color Picker & HEX Converter
Pick colors and convert between HEX, RGB, and HSL
Sample Colors
#3b82f6rgb(59, 130, 246)hsl(217, 91%, 60%)Color Formats in Web Design: HEX, RGB, and HSL
Every color on a screen is defined by mixing red, green, and blue light at different intensities — this is the RGB color model. Web designers use three common formats to express these colors, each with different strengths.
HEX Color Codes
HEX codes are the most common format in web development. The format #RRGGBB uses hexadecimal notation (base 16, digits 0-9 and A-F) where each pair of digits represents the 0-255 intensity of one channel:
- #000000 = black (all channels at 0)
- #FFFFFF = white (all channels at maximum 255)
- #FF0000 = pure red
- #3B82F6 = a medium blue (Tailwind's blue-500)
- #F59E0B = amber/gold
A 3-digit shorthand exists for colors where both digits of each channel are identical: #FFF = #FFFFFF, #F00 = #FF0000, #369 = #336699.
RGB Color Values
RGB uses decimal numbers (0-255) for each channel. It is easier to understand and manipulate than HEX:
- rgb(255, 0, 0) = red
- rgb(0, 128, 0) = dark green
- rgb(59, 130, 246) = blue (Tailwind blue-500)
RGBA adds a fourth channel — alpha (transparency): rgba(59, 130, 246, 0.5) = 50% transparent blue. This is the format to use when you need semi-transparent overlays, shadows, or backgrounds.
HSL: The Designer's Color Format
HSL (Hue, Saturation, Lightness) is the most human-intuitive color format:
- Hue (0-360): The color angle on the color wheel — 0° = red, 120° = green, 240° = blue
- Saturation (0-100%): 0% = gray, 100% = full color intensity
- Lightness (0-100%): 0% = black, 50% = pure color, 100% = white
HSL shines when creating color palettes. To make a lighter version of blue-500 (hsl(217, 91%, 60%)), just increase the lightness: hsl(217, 91%, 75%) = blue-300. This is far more intuitive than trying to calculate lighter HEX values manually.
Practical Color Tips for Developers and Designers
- Use CSS custom properties: Define your brand colors as --color-primary: #3b82f6 and reference them everywhere. This makes rebranding a one-line change.
- Check contrast ratios: Low-contrast text fails WCAG accessibility standards and is harder to read for all users, not just those with visual impairments.
- Build a consistent palette: Use HSL to create 5–9 systematic shades of each brand color (e.g., 50, 100, 200, 300, 400, 500, 600, 700, 800, 900) by varying the lightness in HSL while keeping hue and saturation constant.
- Consider color blindness: About 8% of men and 0.5% of women have some form of color blindness (mostly red-green). Avoid using color as the only indicator of meaning.