Colors Remember how a single Byte of data contains 256 combinations, and each 8-bit code stood for one character you type on a keyboard? Colors on a computer work the same way. The computer assigns each color a binary code, which might look like this:
The chart above is not real, but it gives you an idea. 256 combinations, 256 colors. This is called 8-bit color. In the early years, this was good enough--but very quickly, 256 colors was much too weak. After all, look at the images below, which use 256 colors: In this photo, there are far more than just 256 colors, so the quality looks terrible. To get better images, we need more colors. To get more colors, we need more bits. So we increase from 8-bit color to 16-bit color. With 16-bit color, each color has a 16-bit code, like "00101000101100011". 16 bits has 65,536 combinations (256 x 256). That color is better, but even with that, the quality is not yet perfect; the human eye can see millions of colors. So we need to go higher, to 24-bit color, which has 16,777,216 colors (256 x 256 x 256). The human eye can't see so many colors, so that quality is just fine. However, some computer monitors actually go up to 32-bit color, or more than 4 billion colors. How do you tell a computer what a color is? How do you describe a color in a way that a computer understands? You might remember color mixing from elementary school. Three colors--red, yellow, blue--can make all other colors. Mix red and yellow to get orange, yellow and blue to make green, blue and red to make purple. However, computers show color as light, not paint. And colors of light are different from colors of paint. They mix differently. With light, the three basic colors are red, green and blue (called "RGB"). If you mix red and green, you get yellow. Strange, but that's how it works. Mix red and blue to get a light-purple color ("magenta"), and green and blue to make a light-blue color ("cyan"). Mix all the colors together to make white. Take a very close look at your TV set. Probably you will see something like this: Each small part of the TV picture is made up of red, green and blue elements. By combining those colors and going from black to full brightness, any color can be created. That's RGB color. So how can you type that color so the computer can understand? There's a special code called "hexadecimal." Remember how "binary" counting used only two digits? Well, hexadecimal uses 16! Here they are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. In that arrangement, A=10, B=11, C=12, D=13, E=14, and F=15, the highest digit. When you tell the computer how to make a color, you need six digits. Two are for red, two for green, and two for blue--in other words, red-red-green-green-blue-blue. For example, the color "bright red" would be "FF0000." In other words, FF is the highest red number, while you have 00 for green and 00 for blue--both are completely dark, the lowest number. Green would be "00FF00". Blue would be "0000FF". Do you see how it works? "000000" is black, and "FFFFFF" is white. To make one color darket, just lower the numbers. For example, bright red is FF0000, so plain red might be 990000, and dark red would be 330000. Bright purple would be FF00FF, so dark purple would be 330033. If the code FFFF00 is yellow (red + green), then orange would have more red and less green: FF7700. Brown would be a dark orange, perhaps 993300. Grey would be 777777. And so on. |