Specifying Colours on a Web Page

Specifying Colours . . . "BBC" 3-bit Colours . . . Wimp 4-bit Desktop Colours
256 Colours, Hue+Tint . . . Windoze 216 Colours . . . Cross-Platform Compatible Colours
Mini Colour Chart . . . "Named" (VGA) Colours . . . Netscrap "Named" Colours . . . Colours for Printing

Textual colours can be specified:

  1. Globally in the <BODY> tag, using the attributes
    TEXT=
    LINK=
    VLINK=
    ALINK=
    BGCOLOR=
  2. Locally in a <FONT> tag, using the attribute
    COLOR=
Image colours are contained within the image file format:
in JPEGs, each pixel can (in principle) have any 24-bit colour;
in GIF, each pixel has one of at most 256 colours from its palette.

Textual colours are controlled by the HTML code on a page; but image colours are determined when the image is created (or converted from eg sprite to GIF).

When choosing colours to use (for text or in GIFs), it is worth bearing in mind that what will actually appear in the visitor's browser window will be limited by their software, platform, screen mode, and dithering ability (the latter being notoriously bad on Windoze/Netscrap).

Specifying Colours

When colours (spelt COLOR ;-) are specified in HTML, they are given as a textual string (which means enclosed within quotes), starting with a hash # symbol, followed by six hexadecimal characters representing the amounts of red, green, and blue (respectively) for the colour; thus:
    "#RrGgBb"
where I've used R and r for the high and low nibbles of red, etc;
full red would be "#FF0000",   and so on.

If you're used to specifying colours in this way, you should have no difficulty with this notation.

However, the following tables are provided to indicate the colour codes for the colours you will be familiar with on Acorn machines.

Note that there is no reason to restrict yourself to the sub-set of colours that are "standard" for Acorn; feel free to be a bit more creative, but remember: however delightful a colour you may specify, what actually appears in the browser's window will be limited to the nearest colour available in the particular screen mode in use; so for example, a sixteen colour desktop mode won't be able to show colours like brown, magenta, or pink!

You may notice that in all the examples below, the low nibble is always identical to the high nibble: this means that, in effect, the number of colours tabled are those in the 4096-colour (12-bit) set; and this ought to provide sufficient variety.

"BBC" 3-bit Colours

 0 Black            #000000
 1 Red              #FF0000
 2 Green            #00FF00
 3 Yellow           #FFFF00
 4 Blue             #0000FF
 5 Magenta          #FF00FF
 6 Cyan             #00FFFF
 7 White            #FFFFFF

Wimp 4-bit Desktop Colours

 0 White            #FFFFFF
 1 v lt Gy          #DDDDDD
 2 lt Grey          #BBBBBB
 3 m lt Gy          #999999
 4 m dk Gy          #777777
 5 dk Grey          #555555
 6 v dk Gy          #333333
 7 Black            #000000
 8 dk Blue          #004499
 9 Yellow           #EEEE00
10 lt Green         #00CC00
11 Red              #DD0000
12 Cream            #EEEEBB
13 dk Green         #558800
14 Orange           #FFBB00
15 lt Blue          #00BBFF

256 Colours, Hue+Tint

Hue Colour          Tint000      Tint064      Tint128      Tint192
 0 Black            #000000      #111111      #222222      #333333
 1 dark Red         #440000      #551111      #662222      #773333
 2 med. Red         #880000      #991111      #AA2222      #BB3333
 3 full Red         #CC0000      #DD1111      #EE2222      #FF3333
 4 dark Green       #004400      #115511      #226622      #337733
 5 dark Yellow      #444400      #555511      #666622      #777733
 6                  #884400      #995511      #AA6622      #BB7733
 7                  #CC4400      #DD5511      #EE6622      #FF7733
 8 med. Green       #008800      #119911      #22AA22      #33BB33
 9                  #448800      #559911      #66AA22      #77BB33
10 med. Yellow      #888800      #999911      #AAAA22      #BBBB33
11 Orange           #CC8800      #DD9911      #EEAA22      #FFBB33
12 full Green       #00CC00      #11DD11      #22EE22      #33FF33
13                  #44CC00      #55DD11      #66EE22      #77FF33
14                  #88CC00      #99DD11      #AAEE22      #BBFF33
15 full Yellow      #CCCC00      #DDDD11      #EEEE22      #FFFF33
16 dark Blue        #000044      #111155      #222266      #333377
17 dark Magenta     #440044      #551155      #662266      #773377
18                  #880044      #991155      #AA2266      #BB3377
19                  #CC0044      #DD1155      #EE2266      #FF3377
20 dark Cyan        #004444      #115555      #226666      #337777
21 dark Grey        #444444      #555555      #666666      #777777
22                  #884444      #995555      #AA6666      #BB7777
23                  #CC4444      #DD5555      #EE6666      #FF7777
24                  #008844      #119955      #22AA66      #33BB77
25                  #448844      #559955      #66AA66      #77BB77
26                  #888844      #999955      #AAAA66      #BBBB77
27                  #CC8844      #DD9955      #EEAA66      #FFBB77
28                  #00CC44      #11DD55      #22EE66      #33FF77
29                  #44CC44      #55DD55      #66EE66      #77FF77
30                  #88CC44      #99DD55      #AAEE66      #BBFF77
31                  #CCCC44      #DDDD55      #EEEE66      #FFFF77
32 med. Blue        #000088      #111199      #2222AA      #3333BB
33                  #440088      #551199      #6622AA      #7733BB
34 med. Magenta     #880088      #991199      #AA22AA      #BB33BB
35                  #CC0088      #DD1199      #EE22AA      #FF33BB
36                  #004488      #115599      #2266AA      #3377BB
37                  #444488      #555599      #6666AA      #7777BB
38                  #884488      #995599      #AA66AA      #BB77BB
39                  #CC4488      #DD5599      #EE66AA      #FF77BB
40 med. Cyan        #008888      #119999      #22AAAA      #33BBBB
41                  #448888      #559999      #66AAAA      #77BBBB
42 light Grey       #888888      #999999      #AAAAAA      #BBBBBB
43 Pink             #CC8888      #DD9999      #EEAAAA      #FFBBBB
44                  #00CC88      #11DD99      #22EEAA      #33FFBB
45                  #44CC88      #55DD99      #66EEAA      #77FFBB
46                  #88CC88      #99DD99      #AAEEAA      #BBFFBB
47 Cream            #CCCC88      #DDDD99      #EEEEAA      #FFFFBB
48 full Blue        #0000CC      #1111DD      #2222EE      #3333FF
49                  #4400CC      #5511DD      #6622EE      #7733FF
50                  #8800CC      #9911DD      #AA22EE      #BB33FF
51 full Magenta     #CC00CC      #DD11DD      #EE22EE      #FF33FF
52                  #0044CC      #1155DD      #2266EE      #3377FF
53                  #4444CC      #5555DD      #6666EE      #7777FF
54                  #8844CC      #9955DD      #AA66EE      #BB77FF
55                  #CC44CC      #DD55DD      #EE66EE      #FF77FF
56                  #0088CC      #1199DD      #22AAEE      #33BBFF
57                  #4488CC      #5599DD      #66AAEE      #77BBFF
58                  #8888CC      #9999DD      #AAAAEE      #BBBBFF
59                  #CC88CC      #DD99DD      #EEAAEE      #FFBBFF
60 full Cyan        #00CCCC      #11DDDD      #22EEEE      #33FFFF
61                  #44CCCC      #55DDDD      #66EEEE      #77FFFF
62                  #88CCCC      #99DDDD      #AAEEEE      #BBFFFF
63 White            #CCCCCC      #DDDDDD      #EEEEEE      #FFFFFF

Windoze 216 Colours

(Each of the three primary R G B colours can take any of the six values
0%, 20%, 40%, 60%, 80% or 100%, ie hex values 00, 33, 66, 99, CC or FF)

Here are a sample sixtyfour of them:

        <--------- darker <---------  FULL  --> desaturated (pastel) -->
                                     ------
Red     330000 660000 990000 CC0000  FF0000  FF3333 FF6666 FF9999 FFCCCC
Orange  663300        996600         FF9900         FFCC66
Yellow  333300 666600 999900 CCCC00  FFFF00  FFFF33 FFFF66 FFFF99 FFFFCC
Green   003300 006600 009900 00CC00  00FF00  33FF33 66FF66 99FF99 CCFFCC
Cyan    003333 006666 009999 00CCCC  00FFFF  33FFFF 66FFFF 99FFFF CCFFFF
Blue    000033 000066 000099 0000CC  0000FF  3333FF 6666FF 9999FF CCCCFF
Magenta 330033 660066 990099 CC00CC  FF00FF  FF33FF FF66FF FF99FF FFCCFF
                                     ------
Greys:   Black 000000 333333 666666   Grey   999999 CCCCCC FFFFFF White
There is a full colour chart of all 216 available from
        http://www.lynda.com/hexh.html
or      http://www.lynda.com/nhue.gif
but be warned: it's a 228 Kilobyte download!
So I've created a much smaller one (33 Kilobyte) as shown below:
Acorn/RiscOS users can also download the original !Draw-file as a 6K zip-archive of a 19K draw-file:
<palett.zip>:colour/drw

Cross-Platform Compatible Colours

If you want to play safe and restrict yourself to only those colours that will render on both the VGA/Windoze/Netscrap 216-colour system AND the Acorn 256-colour set (without dithering on either platform), that whittles it down to just 18 colours:
    #000000 Black           #333333 dark Grey
    #666666 med dk Grey     #999999 med lt Grey
    #CCCCCC light Grey      #FFFFFF White

    #CC0000 med dk Red      #FF3333 bright Red
    #CCCC00 khaki/mud       #FFFF33 light Yellow
    #00CC00 medium Green    #33FF33 light Green
    #00CCCC Turquoise       #33FFFF lt Cyan/Azure
    #0000CC med dk Blue     #3333FF bright Blue
    #CC00CC Purple          #FF33FF bright Magenta
Here's a chart of those 18 (except for black and white:-- I assume you know what they look like ;-)

16 colour chart

(oddly enough, the only ones of those that also correspond exactly to the Wimp desktop colours are:
black, white, very dark grey, medium-light grey, and green).

"Named" (VGA) Colours (yeuk)

(Basically, the 3 primary R G B colours take values of 0%, 50%, or 100%)

W3C HTML3.2 lists the following sixteen (not very meaningful) colours
[my attempted interpretation in brackets]:

Maroon [brown] #800000       Red           #FF0000
Olive  [khaki] #808000       Yellow        #FFFF00
Green  [dkGrn] #008000       Lime  [ltGrn] #00FF00
Teal  [dkCyan] #008080       Aqua   [Cyan] #00FFFF
Navy  [dkBlue] #000080       Blue          #0000FF
Purple [dkMag] #800080       Fuchsia [Mag] #FF00FF
Black          #000000       Gray (sic)    #808080
Silver         #C0C0C0       White         #FFFFFF

Netscrap "Named" Colours (even more yeuk)

The following lists (in alphabetical order) those "names" listed in ArcWeb's "RGBcolours" file. Make of them what you will ;-)
White                #FFFFFF              Light Gray        #C0C0C0
Gray                 #808080              Dark Gray         #404040
Black                #000000              Red               #FF0000
Pink                 #FFAFAF              Orange            #FFC800
Yellow               #FFFF00              Green             #00FF00
Magenta              #FF00FF              Cyan              #00FFFF
Blue                 #0000FF

aliceblue            #F0F8FF              antiquewhite      #FAEBD7
aqua                 #00FF00              aquamarine        #7FFFD4
azure                #F0FFFF              beige             #F5F5DC
bisque               #E1E4C4              black             #000000
blanchedalmond       #FFEBCD              blue              #0000FF
blueviolet           #8A2BE2              brown             #A5A52A
burlywood            #DEB887              cadetblue         #5F9EA0
chartreuse           #7FFF00              chocolate         #D2691E
coral                #FF7F50              cornflowerblue    #6495ED
cornsilk             #FFF8DC              crimson           #DC143C
cyan                 #00FFFF              darkblue          #00008B
darkcyan             #008B8B              darkgoldenrod     #B8860B
darkgray             #A9A9A9              darkgreen         #006464
darkkhaki            #BDB76B              darkmagenta       #8B008B
darkolivegreen       #556B2F              darkorange        #FF8C00
darkorchid           #9932CC              darkred           #8B0000
darksalmon           #E9967A              darkseagreen      #8FBC8F
darkslateblue        #483D8B              darkslategray     #2F4F4F
darkturquoise        #00CED1              darkviolet        #9400D3
deeppink             #FF1493              deepskyblue       #00BFFF
dimgray              #696969              dodgerblue        #1E90FF
firebrick            #B22222              floralwhite       #FFFAF0
forestgreen          #228B22              fuchsia           #FF00FF
gainsboro            #DCDCDC              ghostwhite        #F8F8FF
gold                 #FFD700              goldenrod         #DAA520
gray                 #808080              green             #008000
greenyellow          #ADFF2F              honeydew          #F0FFF0
hotpink              #FF69B4              indianred         #CD5C5C
indigo               #4B0082              ivory             #FFFFF0
khaki                #F0E68C              lavender          #E6E6FA
lavenderblush        #FFF0F5              lawngreen         #7CFC00
lemonchiffon         #FFFACD              lightblue         #ADD8E6
lightcoral           #F08080              lightcyan         #E0FFFF
lightgoldenrodyellow #A6FAFA              lightgreen        #90EE90
lightgrey            #D3D3D3              lightpink         #FFB6C1
lightsalmon          #FFA07A              lightseagreen     #20B2AA
lightskyblue         #87CEFA              lightslategray    #778899
lightsteelblue       #B0C4DE              lightyellow       #FFFFE0
lime                 #00FF00              limegreen         #32CD32
linen                #CBFAF0              magenta           #FF00FF
maroon               #800000              mediumaquamarine  #66CDAA
mediumblue           #0000CD              mediumorchid      #BA55D3
mediumpurple         #9370DB              mediumseagreen    #3CB371
mediumslateblue      #7B68EE              mediumspringgreen #00FA9A
mediumturquoise      #48D1CC              mediumvioletred   #C71585
midnightblue         #191970              mintcream         #F5FFFA
mistyrose            #FFE4E1              moccasin          #FFE4B5
navajowhite          #FFDEAD              navy              #000080
oldlace              #FDF5E6              olive             #808000
olivedrab            #6B8E23              orange            #FFA500
orangered            #FF4599              orchid            #DA70D6
palegoldenrod        #EEE8AA              palegreen         #98FB98
paleturquoise        #AFEEEE              palevioletred     #DB7993
papayawhip           #FFEFD5              peachpuff         #FFDAB9
peru                 #CD853F              pink              #FFC0CB
plum                 #DDA0DD              powderblue        #B0E0E6
purple               #800080              red               #FF0000
rosybrown            #BC8F8F              royalblue         #4169E1
saddlebrown          #8B4513              salmon            #FA8072
sandybrown           #F4A460              seagreen          #2E8B57
seashell             #FFF5EE              sienna            #A0522D
silver               #C0C0C0              skyblue           #87CEEB
slateblue            #6A5ACD              slategray         #708090
snow                 #FFFAFA              springgreen       #00FF7F
steelblue            #4682B4              tan               #D2B48C
teal                 #008080              thistle           #D8BFD8
tomato               #FF6347              turquoise         #3EE0D0
violet               #EE82EE              wheat             #F5DEB3
white                #FFFFFF              whitesmoke        #F5F5F5
yellow               #FFFF00              yellowgreen       #9ACD32
Note that I would not recommend for one moment that you actually USE any of these damfool names! The process seems to be:
  1. IETF/W3C devise a perfectly satisfactory hex-triplet colours standard;
  2. Netscrap invent named colours, just to be different;
  3. W3C document SOME of those names, adding a phoney air of respectability;
  4. Netscrap go and invent a whole load more;
  5. Other browser-programmers scratch their heads wondering just what they're supposed to be supporting, and try their best anyway.

Colours for Printing

If you suspect or expect that your visitor may wish to print out one or more of your pages to a colour bubble-jet, you should bear in mind that the four-colour printing process tends to produce colours that are noticeably different to those seen on-screen, and so you may wish to adjust your colours accordingly.

Most colours print significantly darker than they appear on screen, so you could try making them a touch brighter (especially green: go for a bright green on-screen, which will print as a more medium green).

The conversion from Red/Blue/Green values to Cyan/Magenta/Yellow/blacK colours can be done with mathematical precision, yet still not quite print as expected:
A pure blue (eg #0000FF) on screen will print with a distinct purple tinge; you can get round this by adding some green, which both conteracts the purple and makes it less dark.

Avoid colours which are not quite full intensity (eg #EEEE00 for yellow): this will get printed with untidy spatterings of black.


John Alldred, 02Apr99 <john@protovale.co.uk>
http://www.argonet.co.uk/users/protovale/john.html
Back to Home Page . . . . . . Back to "Tutors" page