HEX (hexadecimal) codes are six-digit codes used to represent colors in digital design and web development. They are written in the format 0f #RRGGBB. R represents red, G represents green, and B represents blue.
Red, green, and blue are the primary colors of light, so they can mix into any color. 16,777,216 colors to be exact (this is more than the human eye can see!).
In hex code, their are 256 shades of each primary color, and can be combined to make different shades and hues.
However, for each primary color, there is only two digits. This means it has to use letters to represent numbers. Each pair of characters defines the intensity of the color from 00 (lowest) to FF (highest). This is called “base 16” counting.
HEX code in HTML:
<h1 style=”background-color:#ff0000;”>#ff0000</h1>
<h1 style=”background-color:#0000ff;”>#0000ff</h1>
<h1 style=”background-color:#3cb371;”>#3cb371</h1>
<h1 style=”background-color:#ee82ee;”>#ee82ee</h1>
<h1 style=”background-color:#ffa500;”>#ffa500</h1>
<h1 style=”background-color:#6a5acd;”>#6a5acd</h1>
Code by W3Schools