Reading the digits
Each pair is a channel value in base 16. Two hex digits cover 00–FF, which is 0–255 in decimal — exactly the range of an 8-bit color channel. So #3B82F6 means red 3B (59), green 82 (130), blue F6 (246).
- 00 is the minimum (channel off)
- FF is the maximum (channel full)
- 80 is the midpoint (≈50%)
Why base 16
Hex is compact and maps cleanly onto bytes. Two digits per channel makes a full 24-bit color fit into six characters, which is why early web and graphics formats adopted it and why it stuck.
Shorthand and alpha
A three-digit form like #F00 is shorthand for #FF0000, used when both digits of each pair are identical. An eight-digit form adds a pair for alpha (#RRGGBBAA), where 00 is transparent and FF is opaque.
Hex vs RGB vs HSL
All three describe the same color. Hex and RGB store channels directly; HSL stores hue, saturation and lightness, which is easier to adjust by hand. Converters translate between them without changing the color.