Hexadecimal uses sixteen distinct symbols, in the case of css color the symbols 0–9
to represent values zero to nine (obviously), and A,?B,?C,?D,?E,?F
to represent values ten to fifteen. So, using one Hexadecimal character you can represent 16 values. With two Hexadecimal you can represent 256 (16*16) values.
In RGB
you have colours represented by Red Green Blue (R=0-255, G=0-255, B=0-255), so we use 3 pairs of Hexadecimal symbols! So when you see an RGB color, you can make the calculation below.
Example:
Hex: #4C8ED5
is RGB: 76, 142, 213
.
Because 4C = 76
(Red), 8E = 142
(Green), D5 = 213
(Blue)!
Hope it helps your understanding!
More to read: Hexadecimal on Wikipedia and a nice RGB to Hexidecimal Converter
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…