Hex versus RGB-255
What’s the difference?
Hex and RGB-255 are just two different ways of representing the exact same color system.
Hex includes three datapoints — one red, one green, and one blue. RGB includes the exact same three, but uses regular decimal numbers.
As we noticed in earlier posts, each hex color is a two-digit number, with 16 options (0-F) for each digit. Each of the three colors could be anything from 00, which emits no light of that color, to FF, which emits the maximum brightness of that color.
If we converted this maximum back to decimal, you’d find that FF in hex is the same as 255 in Decimal.
As humans, it’s much easier for us to know that 127 is about half of 255 than it is for us to recognize that 7F is about half of FF. For someone just learning web design, RGB-255 can be a lot easier to understand.
Why bother with hex?
In the early days of computing, storage space and computing power was hugely limited, and programming languages were developed with those limitations in mind. In 1977 when the Apple II introduced color to the commercial market, CSS and JavaScript were still nearly two decades in the future. But in our more modern context, storage space is much easier to come by and growing rapidly, so we have begun to think differently. Languages become more abstract, drifting away from the machine language that will execute the instructions, and focus and more and more on the human thought patterns we use when we write code.
Now, you’ll see more and more programs using RGB-255 notation, because as a community, developers are realizing that good code is written so that humans (their teammates and coworkers) can read it.
Sure, now that you’ve read this blog, you’re an expert on hexadecimal colors, but someone just coming to the table will have a much easier time thinking about colors in a normal, decimal, RGB system.