HTML and CSS Reference
In-Depth Information
h e only dif erence between using RGB with values from 0 to 255 and 0 percent to 100
percent is in perception. You may be thinking that you can be more precise with your colors
using the 256 values instead of the 0-to-100 range of percentages, but that isn't the case
because you can use fractions in percentage assignments. Whether you use the percentage
notation or the 0-to-255 notation really comes down to a matter of personal preference.
Figure 4-4 shows the outcome using the Opera Mini browser on an iPhone.
Figure 4-4: Colors mixed using integer values, shown on a mobile device.
As you can see in Figure 4-4, the mobile device is not picking up the Arial Black font, but it
has no problems with the colors. Be sure to check your mobile device for fonts and other
ef ects if they're essential to how your page looks. Remember: Most computers have a far
more complete set of fonts and styles than mobile devices do. In time, though, they should be
very similar.
In previous chapters, you've seen color assignment made using values made up of alphanu-
meric values. (An alphanumeric value is any value that contains both numbers and letters.)
For example, the value 6F001C generates a rich mocha red. If we break it down, we can see
that it, too, is simply a mixture of red, green, and blue. But to understand what's going on, we
need to understand a little about computer numbering systems.
We're used to counting using a decimal system. We use the values 0 through 9 (ten digits), and
once those ten digits are used up we start over with two digits — 1 and 0 — which we call
“ten.” As you may know, computers are based on switches being in an On state or an Of state.
By substituting a “1” for On and a “0” for Of , we can write a code based on a binary system
using 1s and 0s; so instead of having ten digits to work with, we have only two. Table 4.2
shows what it takes to count up to 16 using the binary system. It also includes a third column
that shows a base-16 numbering system called hexadecimal.
Search WWH ::

Custom Search