Color on the Web 31
PrinciplesWeb Design
Color on the Web
Web Design in a Nutshell, eMatter Edition
ThisWeb Paletteconsists of the 216 colors shared by the Macintosh and PC system
palettes; therefore colors chosen from the Web Palette will render accurately on
Mac or PC displays. The Web Palette was optimized for Macs and PCs; Unix
machines use a different color model for their system palette, therefore “web-safe”
colors may shift or dither when viewed on Unix terminals.
The Web Palette is also known as the Netscape Palette, Netscape 216, Browser-
Safe Palette, Web-Safe Palette, Non-dithering Palette, and the 6× 6 ×6 cube. The
Web Palette is displayed on the web pages for this book athttp://www.oreilly.com/
catalog/wdnut /.
The Web Palette in numbers
An important way to look at the Web Palette is by its numerical values. The Web
Palette recognizes six shades of red, six shades of green, and six shades of blue,
resulting in 216 possible color values (6× 6 ×6 = 216). This is sometimes referred to
as the 6× 6 ×6 color cube. Figure 3-1 shows the cubic nature of this palette.
There are three systems used for defining RGB values. Which one you use
depends on the requirements of your software.
Decimal
Most image editing software displays the RGB value of a color in decimal
values, ranging from 0 to 255. A color’s decimal RGB value might be 51-51-
255, meaning the red value is 51, the green value is 51, and the blue value is
- Note that these numbers specify one of 256 possible values for each
channel; they are not percentage values. Web-safe colors are multiples of 51.
Hexadecimal
HTML and many programming languages require that RGB numbers be speci-
fied in the hexadecimal numbering system. Hexadecimal is a base-16 system
Figure 3-1: The 6× 6 ×6 Color Cube of the Web Palette
Red
(255,0,0)
Green
(0,255,0)
Blue
(0,0,255)
Black
(0,0,0)
White
(255,255,255)