Understanding Color Settings

A Brief Rundown of Numbering Systems

For the most part, the world works on a base-10 numbering system, meaning that counting up to the number "9" involves one column, but then you adjust to two columns to keep track of "tens". Considering the number of toes and fingers the average person has, it's easy to understand why we use 10 as our basis for counting. There are other numbering systems such as base-2 (binary) and base-8 (octal) that count differently. For instance, octal digits are 0-7; when you count 8, it is represented in octal by 10.

Hexidecimal is the numbering system used by HTML for many purposes, most notably to keep track of colors. In hexidecimal, digits go from 0 to F before looping to the next place column. Confused? Maybe this table will help...

Numeric Systems
Decimal ValueBinaryOctalHexidecimal
0000000000
1000010101
2000100202
3000110303
4001000404
5001010505
6001100606
7001110707
8010001008
9010011109
1001010120A
1101011130B
1201100140C
1301101150D
1401110160E
1501111170F
16100002010

Most of you who are reading this are probably doing so from a computer using Microsoft Windows. Thanks to the standard accessories, you can use the calculator to do conversions for you. Open the calculator application and choose the "Scientific" view. Enter the number you want to convert, then click the radio buttons on the upper lefthand section of the calculator keypad; the default is decimal, but by simply choosing 'binary' or 'hex' you can see the resulting conversion.

Why Do I Need to Know the Geeky Stuff?

The hexidecimal (from now on, I'll just call it 'hex' like a real geek) numbering system is essential in understanding how colors are set in HTML. Color adjustment parameters take three hex numbers as arguments, one for each part of the RGB scale. RGB means 'Red, Green, Blue' -- forget what you learned in school about red, blue, and yellow being the primary colors -- these are the colors of light being produced by the "guns" in your TV and computer monitors, so this is the scale we need to work with. Each of the colors has an assigned value, from 00 to FF (0 - 255). By giving a combination of different values, you can produce the ever-impressive 16.7 million different colors (000000 is black, FFFFFF is white). I'm including samples below, but feel free to experiment...

0000000000A10000B40000C70000DA0000EC0000FF
00A10000B40000C70000DA0000EC0000FF0000A1A1
A10000B40000C70000DA0000EC0000FF0000D5962C
8D3BB4A1B4B4A1B4C7FFA1C7C7A1DAA1A1ECC700FF
FFCC00CCFFA14ABBB45A6B719C7ADF2992AA92AA29
3ADBC943FFFFFF48DF72AF99CADE691F33CF8D9CAB

Putting Colors to Work

Using Color in Your Pages

One of the most common uses of color is as a background for your pages. If you view the source of this page, you'll also notice that the color samples above were part of a table (don't worry, we'll get there...) and each sample was simply a different background color for each cell of the table. Color can be used any number of ways, but many of them are handled in the basic

tag.

Let me emphasize that these are by no means all the options available for the


tag, but some that will instantly spice up your pages:


RRGGBB is representative of the two-digit hex numbers for Red(RR), Green(GG), and Blue(BB). For example, the really bright violet cell above was set with BGCOLOR=C700FF.


Setting Individual Text Properties

Although the tag has been deprecated, it is the most flexible way of altering text without the use of style sheets (which are covered in the advanced material). This tag is really nothing without the use of its parameter settings, which provide all the functionality of changing size and color of the font. A single tag can contain multiple parameters, but not conflicting values for the same parameter (i.e. Don't give two "SIZE" parameters, and especially not with different values). Here's a quick rundown:


Now that you have all these wonderful ways to display text and modify the way it looks, and since you know how to put colors into use, it's probably just getting you burning hot to make a series of web pages. There's just one problem: how do you get them to refer to each other? On the next page, we'll talk about linking pages and creating anchors.