iGuideSmart

Color Picker (HEX, RGB, HSL & Contrast)

Pick colors visually and convert instantaneously between HEX, RGB, and HSL with live WCAG AA/AAA accessibility contrast ratios.

HEX: #1D4ED8
RGB: rgb(29, 78, 216)
HSL: hsl(224, 76%, 48%)
White Text Contrast: 6.70:1 (AA)
Black Text Contrast: 3.13:1 (Fail)

Formula & Calculation Logic

Converts sRGB channels (0–255) into HEX, HSL (Hue/Saturation/Lightness), and linear WCAG relative luminance to verify AA (4.5:1) and AAA (7:1) readability.

Primary Formula

Contrast Ratio = (L₁ + 0.05) ÷ (L₂ + 0.05) (Relative sRGB Luminance)

Example: Brand Blue #1D4ED8 against White #FFFFFF

  1. 1
    Convert HEX to RGB
    1D=29, 4E=78, D8=216
    rgb(29, 78, 216)
  2. 2
    Compute WCAG contrast vs #FFFFFF
    (1.0 + 0.05) ÷ (0.095 + 0.05)
    7.23 : 1 (AAA Pass)

WCAG 2.1 Accessibility Contrast Thresholds

Minimum luminance contrast ratios for readable web interfaces.

Showing 3 of 3 reference values
WCAG 2.1 contrast ratio guidelines
StandardNormal TextLarge Text (18pt / 14pt bold)UI Components
WCAG Level AA (Target)4.5 : 13.0 : 13.0 : 1
WCAG Level AAA (Enhanced)7.0 : 14.5 : 13.0 : 1
Pure Black on White21.0 : 121.0 : 1Maximum possible

Practical Real-World Use Cases

Design Systems & Dark Mode Tokens

Translate Figma HEX swatches into CSS HSL/RGB variables and verify WCAG accessibility.

Accessible Button & Link Styling

Check instantly whether white or dark text provides higher contrast on a chosen swatch.

Color Picker (HEX, RGB, HSL & Contrast) – Frequently Asked Questions

What contrast ratio is required for WCAG AA compliance?
WCAG 2.1 Level AA requires at least 4.5:1 for normal body text and 3:1 for large text (18pt+ or 14pt+ bold).
Why is HSL easier to tweak than RGB?
HSL separates Hue (color wheel angle 0–360°), Saturation, and Lightness, making hover tints and shades predictable.
How does 3-digit shorthand HEX (#F0A) expand?
Each nibble repeats twice: #F0A expands directly to #FF00AA.
View all Developer Tools →