Decimal and Hexadecimal
I’ve recently followed my wife into the world of art, and have become fascinated with the challenge of portraiture.
To create a face on a piece of paper that makes you feel as if that particular person is there looking at you is remarkably difficult, especially if it is someone that you know really well. But it’s not really art, more of a craft, because you work from a photograph and, because the addition or subtraction of even a millimetre makes a huge difference, it becomes kind of technical.
Then I moved on to colour and that’s when I went down a rabbit hole (you know, click on this, click on that, getting deeper and deeper down the, well, yes, rabbit hole).
As you may know all colours have a number or code. You’ve only got to click on the highlight icon in Word or Excel, then Custom and you’ll see something like this –
So that pink in RGB is 255 (out of 255) units of Red, 102 (out of 255) units of Green and 153 (out of 255) units of Blue.
In Hexadecimal its value is FF6699 or more simply FF (255) 66 (102) 99 (153)
So what’s this all about? How do we get FF out of 255?
Further down the rabbit hole.
In decimal we count 0 to 9, then we start all over 1 followed by 0 to 9 (10 to 19)
In Hex we count from 0 to 15, then we start all over 1 followed by 0 to 15. But there aren’t enough numeral characters for this, so we need new characters for 10 through 15.
These are A (10), B(11), C(12) …. F(15). So just as 99 = 10 x 10 – 1, so FF = 16 x 16 – 1, or 255
Working backwards the number for Green is 102 in RGB. Divide is by 16 = 6.375, so our first number is 6 (from 6 x 16) then multiply the remainder by 16. 16 x ,375 = 6, so our second number is also (coincidentally) 6.
If this is confusing you, let’s do 153 in decimal. Divide it by 100 (because it is three digits long), This gives us 1.53, so our first digit is 1.
Multiply the remainder by 10 and we get 5,3 so the next digit is 5
Multiply the remainder by 10 = the last digit 3, and we’re back to 153.
Phew! And I thought this was going to be art.
Next question – Why Red Green Blue and not the primary colours Red Yellow Blue?
Answer. Red Green Blue are primaries for emitters (sources that emit light) while Red Yellow Blue are primaries for absorbers (surfaces that absorb light).
So, mix Red Yellow Blue paints and you’ll get black. Shine light from Red, Green, Blue sources and you’ll get white.
Which is why White in RGB (which is used for emitters, such as you computer or TV screen) is R 255, G 255, B 255 and Black is R 0, G 0, B,0
While in Hex White is FFFFFF and Black is 000000
So that’s it. I must say, I enjoyed the rabbit hole. Now back to my artistic efforts!