Web browsers and design tools represent sRGB colors in three primary notations: hexadecimal (HEX), Red-Green-Blue (RGB), and Hue-Saturation-Lightness (HSL). All three describe the exact same color space, so converting between them is lossless and reversible.
#RRGGBB or #RGB): Encodes Red, Green, and Blue channels as two-digit base-16 numbers from 00 (0) to FF (255). For example, #3b82f6 means Red=59, Green=130, Blue=246. Three-digit shorthand like #f0a expands to #ff00aa.rgb(r, g, b)): Expresses each channel as a decimal integer from 0 to 255. Convenient when programmatically blending colors or adding an alpha channel with rgba(59, 130, 246, 0.5).hsl(h, s%, l%)): Represents color the way humans perceive it: Hue (0°–360° on the color wheel, where 0° is red, 120° is green, 240° is blue), Saturation (0%–100% intensity), and Lightness (0% black, 50% pure hue, 100% white).hsl(217, 91%, 60%) → hsl(217, 91%, 50%)).rgb(...) / hsl(...) updates the live preview swatch and all other formats instantaneously.When picking foreground text and background colors for UI buttons, badges, or alerts, aim for a minimum WCAG AA contrast ratio of 4.5:1 for body text and 3:1 for large headings or UI borders. Converting colors to HSL makes it easy to test accessibility: if a saturated blue like hsl(217, 91%, 60%) looks too bright behind white text, lowering Lightness to 45% (#1d4ed8) immediately improves legibility while keeping the exact same brand hue.