HEX color codes explained

A HEX code represents a color as a six-digit hexadecimal number. In #FF5733, the first two digits are the strength of red, the middle two green, and the last two blue.

Each pair ranges from 00 to FF, which corresponds to 0–255 in decimal. So #FF0000 is pure red, the same as rgb(255, 0, 0).

There is also a three-digit shorthand (#F53), which is equivalent to repeating each digit, i.e. #FF5533. It is the most widely used notation on the web and in CSS.