COLOURS

Primary/Secondary Colours

All light is composed of 3 primary elements (blue, green and red) from which all other "colours" are derived by mixing greater or lesser amounts of each element.

Most objects absorb some (or all) of one or more of the primary elements of light, reflecting only the remainder which we see as a "colour". Grass appears green because chlorophyll (present in all plants) completely absorbs the red and blue elements of light, and only reflects the green element.

Another 3 secondary colours - yellow, magenta and cyan (or aqua) - are each composed exclusively of only 2 of the 3 primary colours. Thus "yellow" is composed of "green+red" (ie there is a total absence of "blue"), "magenta" is "blue+red", and "cyan" is "blue+green". These 3 secondary colours of light are often called the "primary colours of paint" by artists and oil-painters.

White and grey are "colours" of luminosity, composed of greater or lesser degrees of an equal mixture of all 3 primary colours. Black is the total absence of all primary light, ie. it has no "colour" at all because all 3 primary colours are "missing".


Hexadecimal Colour Values

Colour names (eg. "navyblue", "copper") vary from browser to browser, but colour values do not. The BODY BGCOLOR attribute, the FONT COLOR attribute and the 4 text-colour attributes (TEXT-LINK-ALINK-VLINK) all take rgb values in the form #rrggbb. Each r, g and b value is a hexadecimal value between 0-255. Black is #000000 and white is #FFFFFF. Any value with identical rr,gg,bb parts is a shade of grey.

Thus dark blue is written as "#00007F" (7F=127 or half-value) while light blue is #0000FF (FF=255 or full-value). Mixing colours is an additive process - the larger the value, the more light goes into the final colour. Using <FONT COLOR> attributes, a 16-colour screen chart is written as:

Colour (medium):ValueColour (light):Value


Medium Red#7F0000 Red#FF0000
Medium Yellow#7F7F00 Yellow#FFFF00
Medium Green#007F00 Green#00FF00
Medium Cyan#007F7F Cyan#00FFFF
Medium Blue#00007F Blue#0000FF
Medium Magenta#7F007F Magenta#FF00FF
Medium Grey#7F7F7F Light Grey#C0C0C0
Black#000000 White#FFFFFF


The actual number of video-colours available depends on the operating system in use. The original "Windows 16-color" standard is a reflection of the basic 4-bit operating filesize, having 24 (=16) bits of information. The next filesize up, 8-bits, enables 28 (=256) allowable colour values, and a 16-bit file gives 216 (=16 million) possible variations.

Only 16 basic pre-defined colours have names universally recognised by both Netscape and Explorer browsers. They are:

(LIGHTER:) White   Silver   Red   Lime   Blue   Yellow   Magenta   Cyan  
(DARKER:) Black   Gray   Maroon   Green   Navy   Olive   Purple   Teal  

Here's a 27-color chart based on 3 x3 x3 combinations of "00", "7f" and "ff", with some of their "accepted" font descriptions:

000000-III 00007F-III 0000FF-III black, navy, blue
007F00-III 007F7F-III 007FFF-III green, teal, slate blue
00FF00-III 00FF7F-III 00FFFF-III lime, spring green, cyan/aqua
7F0000-III 7F007F-III 7F00FF-III maroon, purple, med.slate blue
7F7F00-III 7F7F7F-III 7F7FFF-III olive, gray, (?),
7FFF00-III 7FFF7F-III 7FFFFF-III med.spring green, (?), (?)
FF0000-III FF007F-III FF00FF-III red, (?), magenta/fushsia
FF7F00-III FF7F7F-III FF7FFF-III (?), (coral), orange?
FFFF00-III FFFF7F-III FFFFFF-III yellow, (?), white

"What's in a name?..."
The difficulty of using descriptions is immediately illustrated by the fact that none of the 27 "balanced" colours seem to match any of the following names (which when used throw up other colour-shades entirely): brown, chocolate, cream, crimson, indigo, khaki, x-lemon, magnolia, ochre, orange, pink, scarlet, sienna, tangerine, vermilion, violet...


Here's a 125-color chart based on 5 x5 x5 (00,3f,7f,bf,ff) combinations. By now the idea of "accepted" font descriptions becomes almost impossible to track, especially considering that "copper" for example is likely to show as two different shades in two different browsers (or perhaps not even be recognised as a name by one).


000000-III 00003F-III 00007F-III 0000BF-III 0000FF-III black, (?), (navy), (ochre), blue
003F00-III 003F3F-III 003F7F-III 003FBF-III 003FFF-III (?), (?), (?), (?), (?)
007F00-III 007F3F-III 007F7F-III 007FBF-III 007FFF-III (green), (?), (?), (?), slate blue
00BF00-III 00BF3F-III 00BF7F-III 00BFBF-III 00BFFF-III (?), (?), (?), (?), (?)
00FF00-III 00FF3F-III 00FF7F-III 00FFBF-III 00FFFF-III (lime), (?), spring green, (?), cyan
3F0000-III 3F003F-III 3F007F-III 3F00BF-III 3F00FF-III (?), (?), (?), (?), (?)
3F3F00-III 3F3F3F-III 3F3F7F-III 3F3FBF-III 3F3FFF-III (?), (?), (?), (?), (?)
3F7F00-III 3F7F3F-III 3F7F7F-III 3F7FBF-III 3F7FFF-III (?), (?), (?), (?), (?)
3FBF00-III 3FBF3F-III 3FBF7F-III 3FBFBF-III 3FBFFF-III (?), (?), (?), (?), (?)
3FFF00-III 3FFF3F-III 3FFF7F-III 3FFFBF-III 3FFFFF-III (?), (?), (?), (?), (?)
7F0000-III 7F003F-III 7F007F-III 7F00BF-III 7F00FF-III (?), (?), (purple), (?), med.slate blue
7F3F00-III 7F3F3F-III 7F3F7F-III 7F3FBF-III 7F3FFF-III (?), (?), (?), (?), (?)
7F7F00-III 7F7F3F-III 7F7F7F-III 7F7FBF-III 7F7FFF-III (?), (?), (gray), (?), (?)
7FBF00-III 7FBF3F-III 7FBF7F-III 7FBFBF-III 7FBFFF-III (?), (?), (?), (?), (?)
7FFF00-III 7FFF3F-III 7FFF7F-III 7FFFBF-III 7FFFFF-III med.spring green, (?), (?), (?), (?)
BF0000-III BF003F-III BF007F-III BF00BF-III BF00FF-III (?), (?), (?), (?), (?)
BF3F00-III BF3F3F-III BF3F7F-III BF3FBF-III BF3FFF-III (?), (?), (?), (?), (?)
BF7F00-III BF7F3F-III BF7F7F-III BF7FBF-III BF7FFF-III (?), (?), (?), (?), (?)
BFBF00-III BFBF3F-III BFBF7F-III BFBFBF-III BFBFFF-III (?), (?), (?), (?), (?)
BFFF00-III BFFF3F-III BFFF7F-III BFFFBF-III BFFFFF-III (?), (?), (?), (?), (?)
FF0000-III FF003F-III FF007F-III FF00BF-III FF00FF-III red, (?), (?), (?), magenta
FF3F00-III FF3F3F-III FF3F7F-III FF3FBF-III FF3FFF-III (?), (?), (?), (?), (?)
FF7F00-III FF7F3F-III FF7F7F-III FF7FBF-III FF7FFF-III (?), (?), (coral), (?), orange?
FFBF00-III FFBF3F-III FFBF7F-III FFBFBF-III FFBFFF-III (?), (?), (?), (?), (?)
FFFF00-III FFFF3F-III FFFF7F-III FFFFBF-III FFFFFF-III yellow, (?), (?), (?), white