Typically when talking about or dealing with optic light, all colors are created by varying amounts of three colors: red, green & blue, commonly abbreviated as RGB. The color black is created by the absence of any and all red green or blue light. The color white is created by the presence of the maximum possible red green or blue light. Each of these individual amounts can be respected as integer ranging from 0-255, or can be represented as a hexadecimal code. Hexadecimal color codes must precede with a hash mark (#) and are usually always 6 characters long. The Red Green and Blue are represented each as 2 character hex, the 0-255 which I mentioned earlier is now represented by 00-FF when thinking in hex. I believe we are given approximately 65,000 different possible color choices.
<style type="text/css">
.red1 { color: red; } /* textual */
.red2 { color: rgb(255,0,0); } /* using the css rgb function */
.red3 { color: #ff0000; } /* typical hex */
.red4 { color: #f00; } /* shorthand hex */
</style>
Since hex color codes are always 6 characters long. And the pattern goes: first two chars represents amount of red, next two chars represents amount of green, etc. If there should be redundancy only in a sense that the 2 characters are identical, and this is true for each Red, Green & Blue, then you may write the hex color code in shorthand. Example: #66aa33 == #6a3
With that in mind we can quickly create the following 8 colors:
| Color | R | G | B |
|---|
| Black | 0 | 0 | 0 |
|---|
| Red | 1 | 0 | 0 |
|---|
| Green | 0 | 1 | 0 |
|---|
| Blue | 0 | 0 | 1 |
|---|
| Yellow | 1 | 1 | 0 |
|---|
| Magenta | 1 | 0 | 1 |
|---|
| Cyan | 0 | 1 | 1 |
|---|
| White | 1 | 1 | 1 |
|---|
Years ago I found a list of 247 defined web safe colors that had names and rendered in MSIE. Its kind of a neat list but I showed off one of my websites at a client's location under Safari once and it didn't know most of the textual color names I used. The w3c has defined that only 16 colors have textual names defined in the specs: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.