As seen in the table example above, with one hex digit we can represent numbers up to and including 15. Add another column and we can represent numbers up to 255, 4095 with another column, and so on.
The terseness and byte-aligned nature of hexadecimal numbers make them a popular choice for software engineers working on low-level code-bases or embedded software.
## Uses of Hexadecimal Numbers in JavaScript
JavaScript supports the use of hexadecimal notation in place of any integer, but not decimals.
As an example, the number 2514 in hex is 0x9D2, but there is no language-supported way of representing 25.14 as a hex number.
Using hexadecimal in your code is a personal and stylistic choice, and has no effect on the underlying logic your code implements.
## Uses of Hexadecimal Numbers in CSS
CSS has for a long time used hexadecimal notation to represent color values. Consider the following selector:
```css
.my-container {
background-color: #112233;
color: #FFFFFF;
}
```
The `background-color`'s value is in fact three hex bytes.
The CSS processor treats these as three individual bytes, representing Red, Green, and Blue.
In our example, 11 corresponds to the Red color component, 22 corresponds to the Green color component, and 33 to the Blue color component.
There is currently no way as of CSS3 to define a color with an alpha component using hex.
The proposed CSS4 Draft<sup>1</sup> includes a proposal to allow for an extra byte to specify alpha values.
For now, use of the standard `rgba()` function is the recommended way to add an alpha value to your colors.
* [How Do HEX Color Codes Work? (in 60 seconds)](https://www.youtube.com/watch?v=c56x1aj2CPA) - Good Video which also explains a little bit about Hexadecimal Numbers.
* [Hex Codes & Color Theory](https://www.youtube.com/watch?v=xlRiLSDdqcY) - A Longer Video which delves into Color theory (Such as what are additive colors and what are subtractive colors etc.) and it also points to other resources for delving deeper into the topic.
* [Web Colors](https://en.wikipedia.org/wiki/Web_colors) - Wikipedia Article on how colors are used on the web.
* [Wikipedia article about Hexadecimal code](https://en.wikipedia.org/wiki/Hexadecimal)