![]() |
Building 3D Models for the WebTechnical Details of 2D Web Graphics |
<BODY BGColor=ffcc99 TEXT=003399 VLINK=cc3300 LINK=663300>are color specifications, containing two characters for each of red, green, and blue. For example, 364cf0 assigns 36 to red, 4c to green, and f0 to blue. 36, 4c, and f0 are base 16 numbers. The number system that we mortals use is base 10. When we write the number 57, we mean 5 tens and 7 ones. The number 36 in base 16 means 3 sixteens and 6 ones. This is equivalent to the base ten number 3x16 + 6 = 54.
Our familiar base 10 number system requires 10 digits--0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. We don't need any more than this because once we get past the number 9, we carry a digit to the tens place. Base 16 requires 16 digits. Conventionally, they are called 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f. Here are some base 16 numbers and their base 10 equivalents.
A 24 bit color monitor supports 256 levels of red, 256 levels of green, and 256 levels of blue. These levels are numbered 0 to 255 in base 10 (0 to ff in base 16). Photoshop uses base 10 for RGB colors, while HTML uses base 16. The HTML color ff00cc corresponds to the Photoshop color R 255, G 0, B 204, since ff corresponds to 255, 00 corresponds to 0 and cc corresponds to 204. Here are some common colors:
Base 16 Base 10 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 a 10 b 11 c 12 d 13 e 14 f 15 10 1x16 + 0 = 16 11 1x16 + 1 = 17 12 1x16 + 2 = 18 13 1x16 + 3 = 19 14 1x16 + 4 = 20 36 3x16 + 6 = 54 c4 12x16 + 4 = 196 cc 12x16 + 12 = 204 ff 15x16 + 15 = 255
The 216 browser-safe colors are combinations of 00, 33, 66, 99, cc, and ff. For example, 33cc99 is a browser-safe color, but 04cf93 is not.
Color Photoshop HTML White R 255 G 255 B 255 ffffff Red R 255 G 0 B 0 ff0000 Green R 0 G 255 B 0 00ff00 Blue R 0 G 0 B 255 0000ff Yellow R 255 G 255 B 0 ffff00 Black R 0 G 0 B 0 000000
Go back to 2D Graphics Formats