But an RGB color can take from three to nine digits. The hex color is always 6 digits in length. Instead of using a format like RGB, the hex format can be more convenient, depending on the context.įor example, here is the same color expressed first in hex and then as RGB: Hex color is another way to express colors. Next, let’s discuss why hex colors are used and what is the relationship to RGB colors. But because the hex colors use a hexadecimal base, the channel values range from 00 to FF. What Is a Hex Color?Ī hex color is a color that uses a hexadecimal base to express the amount of color in each color component (red, green, blue).Ī hex color is expressed in the following format: #RRGGBBĮach channel can have a value from 0 to 255. Now that you understand what are numeric systems and hexadecimal numbers, it becomes easier to understand what is a hex color. To support understanding, let’s count a bit further. This is why the number 16 in the decimal base is 10 in the hexadecimal base. Thus you’ll need to start re-using the numeric symbols after the fifteenth symbol, F. In hexadecimal, you have 16 symbols to represent numbers. So the last 6 symbols are letters from ‘A’ to ‘F’ (or from ‘a’ to ‘f’ in lowercase).įor example, let’s count to 16 in a hexadecimal system: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10 And because we don’t have more numeric symbols, we must use letters. The first 10 symbols are numbers from 0 to 9. Unlike the traditional decimal base, a hexadecimal base has 16 symbols for representing numbers. Understanding how the hexadecimal number system works is essential to understanding hex colors. Hexadecimal BaseĪ hex color uses a hexadecimal base for representing colors. To learn more about the binary system, make sure to read my comprehensive guide to the binary number system. Next, let’s talk about another common number system called the hexadecimal base. Thus, all the calculations and computations must be done with “0s and 1s”, that is, bits that are either on or off. There are no other states than one of these two. A bit can only be “on” or “off”, that is, 0 or 1. This is because a computer uses bits as its basic building blocks. This is because you run out of numbers after 1.Īs another example, let’s count to 7 in a binary system: 0, 1, 10, 11, 100, 101, 110, 111Ī binary system is famous for being used in computers. In the binary system, 10 is already the third number from 0. So any number can only consist of 0s and 1s.įor example, let’s count to “ten” in a binary system: 0, 1, 10 The binary system means you can only use numbers 0 and 1 to perform calculations. Let’s take a quick look at the binary system. For example, computers use binary systems. When someone asks you to count to ten, you don’t have to ask “In which number system?”.īut it’s important to realize there are other numeral systems too. No matter how far you calculate in a decimal base, you will always use numbers between 0-9. But once you go past nine, you have to start reusing the previous numbers.įor example, the number 10 is not a unique number character. In the decimal number base, counting to nine is possible by using separate numbers.
0 Comments
Leave a Reply. |