Saturday, December 7, 2024

A Quick Color Explanation

     It’s pretty easy to understand the word color codes, but those hex codes are rather strange. Here’s a quick explanation.

      The three primary colors are red, blue, and yellow. Remember that from high school art? They’re called the primary colors because there are no two “lesser” colors that make them up. Purple is not a primary color because it can be created through combining equal parts of blue and red.

     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. It’s a process known as “additive color”.

     You would think that the TV’s and computer monitors of the world would simply use the three primary color to start with, but nothing in life can just be that easy. The three colors used to start additive color mixing are red, green, and blue. Why, you ask? 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. Stay with me here…

     To go on, I need to explain a second process of working with colors, “subtractive color.” Subtractive color is the concept of combining colors to make another, like mixing red and blue paint to get purple. That may sounds like additive color, but in reality, colors are made by subtracting a hue out of the color scheme by adding more of another. Adding more white to black makes it more silver subtracting more black as more white is mixed in. Get it?

      One other big difference between additive and subtractive color, and this is the key, is what you get when you add them all together.

     If you add all the colors together in a subtractive color method, you get black. Why? Because you added them all together and all those colors subtracted from all the others leaving no set color…or black.

     A computer, on the other hand, works with light, not paint or any other goopy stuff. Mix a computer’s additive colors, red, green, and blue, together, you get white.

      No kidding, you really do. Shine a white light at a prism or a lead crystal glass. You’ll get a rainbow of colors. Actually, that’s how a rainbow is created. White light is being shown through water in the air. That separates the white light into the “rainbow” of colors.

      Now on to the 6-digit representation of color known at the hex code.


Basic Hexadecimal Notation:

Hex numbers use 16 digits:


0 1 2 3 4 5 6 7 8 9 A B C D E F


      Zero, “0”, is the smallest representations of a color. It’s almost the total absence of color. F 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 once for blue, in that order. Put the three, two-digit, codes together and you get a 6-digit hex code. The hex code is just a representation of the red, green, and blue intensity, in that order. The computer creates the three intensities, mashes them together, and you get a single shade of color.

     For an example, here are the opposite ends of the color scale:

FFFFFF

      The code above is equal to white. Why? Notice the three colors are all set to FF. That means the highest level of red, green, and blue. As I said above, in a computer, or television, the combination of all three primary colors creates white. Now here’s black:

000000

      This is just the opposite. All three settings of red, green, and blue are set to a total absence of color. Black.


     Now, here are a few other codes and their breakdown:

FFFF00

     Let’s start with the concern from up above, yellow. The code above produces pure yellow. Notice the red and the green are at full tilt. There is no blue. By mashing the red and green up against each other, the red cancels out the blue and all that is left is the yellow. It’s actually a subtractive color method being employed in an additive world. Man, this gets loopy, huh?

DC143C

     The code above creates a shade of red called “crimson.” The red setting, DC, is pretty intense. There’s not much green. Blue is set a little less than halfway up.

EE82EE

     That’s violet. The Red and the Blue are at pretty high levels. The green is there, but at a lower level. Now, this is not purple, but violet. Purple, as I said above, is a combination of red and blue alone. The code is 800080. Notice there’s no green at all. Just an equal amount of red and blue.


FFA500

     That’s orange. There’s lots of red, not quite an equal level of green, and no blue.

      That’s how the hex codes work. This lesson probably won’t make you an expert in color creation, but at least you’ll be able to understand the creation of color in a computer.

     So, are there more hex code colors that what I show above? Oh, yes. There are thousands upon thousands covering every color in the scale from pure black to pure white. Every time you change even one of the red, green, or blue levels, you change the color.

     Feel free to change the colors to get exactly the shade you want.


Enjoy!

 

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured