How does Hex Color code work?

#F9D544 #FFFFFF #EE82EE #FFA500 #636363 Have you seen something like this? Yes, This is Hexadecimal color code used in CSS (cascading style sheet). A computer can display millions of different colors, and remembering the names of every single one of them is impossible. That’s why we need Hex color code.

Well,  It’s pretty easy and simple to understand the word color codes, but those hex codes are rather strange. Here’s a real quick explanation. Let’s start with the high school art lecture. Did you remember that the three primary colors are red, blue, and yellow. Now why they called primary? Because there are no two “lesser” colors that make them up. Got it!

Now let’s move on to the real digital world. In the world of mechanical things that make color, like a television, or a computer screen, color is created through the mixing of three basic colors to make other colors. This process known as “additive color”. TV’s and computer monitors simply use the three primary color to start with. No wait read completely. Obviously nothing in life can just be that easy. The three colors used to start additive color mixing are red, green, and blue. Why? Because by starting with one composite color, green, you can still create yellow because it’s contained in the green. In addition, now you are actually starting with four colors, red, green, blue, and yellow.

Well just like the addictive color the another concept is subtractive color. Subtractive color is the concept of combining colors to make another, like mixing red and blue paint to get purple. Got it?

Here’s how Hex Color code work!

A computer, on the other hand, works with light.  Now on to the 6-digit representation of color known at the hex code.

Hex numbers use 16 digits:
0 1 2 3 4 5 6 7 8 9 A B C D E F
Here, Zero “0”, is the smallest representations of a color. It means total absence of color. F is at position 15, is 15 times the intensity of the color of 0.  Combinations of these digits create different shades of a particular color. Double Zero, “00,” is equal to zero hue. FF is equal to a pure color. This color representation is done three times, once for Red, once for Green, and another for Blue, in order. Now here’s the key statement the three, two-digit, codes together and you get a 6-digit hex code.


So with one Hexadecimal you can represent 16 values. With two Hexadecimal you can represent 16*16 values (=256 values). In RGB you have (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 this calculation:

For example Hex Color code: #FEFAFD is RGB: 254,250,253.

Because FE=254(Red), FA=250(Green), FD=253(Blue)!

Similarly FFFFFF is equal to White. 000000 represent black. All three settings of red, green, and blue are set to a total absence of color. Got it?

Yeah feel free to change the colors to get exactly the shade you want. Here is the RGB to Hexidecimal Converter. I hope you got it, and fell free to ask related question. And also you can also use small letters instead of capital.!

Have a colorful day!

Ivory Soda

'Ello there!, I do WordPress stuff, in love with Windows 10 & Lumia (Yes! Still Lumia). I also write about Microsoft & Technology for various publications.