The Six Characters That Built the Web: A History of Hex Color
A Shorthand for Light: Every color on a modern screen is a mixture of red,
green, and blue light โ the additive primaries that LCD and OLED panels use. Each channel has
256 possible intensities (0โ255 in decimal), which maps neatly to two hexadecimal digits
(00โFF). The notation #RRGGBB packs all three channels into six compact
characters, making it easy to type, copy, and read without needing a separate calculator. The
entire visible palette of 16,777,216 colors fits in a format shorter than most passwords.
From Mosaic to W3C: The hex color format was popularized in 1994 by the NCSA
Mosaic browser, which borrowed the convention from the X Window System's color naming
infrastructure. Early HTML pages used it informally in attributes like bgcolor="#000080". By 1996, HTML 3.2 formally standardized the notation, and it
became permanent web infrastructure. Thirty years later, browsers still parse the same
six-character strings โ a rare case of computing backwards-compatibility holding firm across
hardware generations.
Why RGB, HSL, and RGBA All Matter: RGB is hardware-native โ monitors literally
mix those three light beams. But designers think differently. HSL (Hue, Saturation, Lightness)
aligns with human color intuition: rotate the hue, pull back the saturation, and you get
natural-feeling tonal variants without hunting for new numbers. CSS introduced hsl() in CSS Level 3 precisely for this reason. RGBA adds the alpha channel for
transparency โ critical for overlays, shadows, and glass-morphism effects that are impossible
with solid hex codes alone. Modern design systems use all three formats for different purposes
in the same stylesheet.
The 3-Digit Shorthand: A lesser-known feature: #RGB is valid CSS
shorthand where each digit is doubled โ #F0C expands to #FF00CC.
This was introduced in CSS Level 1 (1996) and is still fully supported in every browser. It
saves keystrokes when working with colors that happen to have repeated hex pairs, which is
surprisingly common in rounded palette systems and design tokens.