HTML and CSS Reference
In-Depth Information
Table 3.2: CSS2.1 colors (continued)
Color Name
RGB Decimal
RGB Percentage
Hexadecimal
blue
rgb(0,0,255)
rgb(0%,0%,100%)
#0000ff
fuchsia
rgb(255,0,255)
rgb(100%,0%,100%)
#ff00ff
gray
rgb(128,128,128)
rgb(50%,50%,50%)
#808080
silver
rgb(192,192,192)
rgb(75%,75%,75%)
#c0c0c0
orange
rgb(255,170,0)
rgb(100%,67%,0%)
#ffaa00
olive
rgb(128,128,0)
rgb(50%,50%,0%)
#808000
lime
rgb(0,255,0)
rgb(0%,100%,0%)
#00ff00
teal
rgb(0,128,128)
rgb(0%,50%,50%)
#008080
purple
rgb(128,0,128)
rgb(50%,0%,50%)
#800080
navy
rgb(0,0,128)
rgb(0%,0%,50%)
#000080
maroon
rgb(128,0,0)
rgb(50%,0%,0%)
#800000
Many years ago computer monitors could display only 256 colors (including
black and white). Of these 256 colors, only 216 of them would reliably display the
same on both Windows and Macintosh computers. his set was referred to as
the “web-safe” color set. hese web-safe colors are distributed evenly through-
out the entire set of colors such that they occur whenever all the components
are even multiples of 20 percent, which is the same as multiples of 51 decimal.
Converted to hexadecimal, web-safe colors occur when all the components have
one of these values: 00 , 33 , 66 , 99 , cc , or ff . An example is #3366ff .
Today, most devices, including mobile devices, can display thousands or
millions of colors. Sticking to web-safe colors is not as important as it once
was. Nevertheless, many web designers still use web-safe colors because they
are easier to remember and it helps keep the colors consistent from page
to page.
CSS also accepts a shorthand hexadecimal notation consisting of the hash
sign followed by three hexadecimal digits. he idea is that each of the three
digits will be duplicated so that #f00 is equal to #ff0000 (red), for example, or
#666 is equal to #666666 (dark gray).
 
Search WWH ::




Custom Search