INTRODUCTION TO WEB GRAPHICS AND DESIGN
INTRODUCTION · SYLLABUS · TUTORIALS · CLASSLIST
Color
Color or colour is the perception of the frequency (or wavelength) of light, and can be compared to how pitch (or a musical note) is the perception of the frequency or wavelength of sound.
It is a perception which in humans derives from the ability of the fine structures of the eye to distinguish (usually three) differently filtered analyses of a view. The perception of color is influenced by biology (some people are born seeing colors differently or not at all; see color blindness), long-term history of the observer, and also by short-term effects such as the colors nearby.
The science of color is sometimes called chromatics. It includes the perception of color by the human eye, the origin of color in materials, color theory in art, and the physics of color in the electromagnetic spectrum.
Authors of web pages have a variety of options available for specifying colors for elements of web documents. Colors may be specified as an RGB triplet in hexadecimal format (a hex triplet); they may also be specified according to their common English names in some cases.
The first versions of Mosaic and Netscape Navigator used the X11 color names as the basis for their color lists, as both started as X Window System applications. The origin of the X11 color list is unknown.
Hex triplet
A hex triplet is a six-digit, three-byte hexadecimal number used in HTML and CSS, and other computing applications, to represent colors. The bytes represent the red, green and blue components of the color. One byte represents a number in the range 00 to FF (in hexadecimal notation), or 0 to 255 in decimal notation. The hex triplet is formed by concatenating three bytes in hexadecimal notation, in the following order:
- Byte 1: red value
- Byte 2: green value
- Byte 3: blue value
- Byte 2: green value
For example, consider the color where the red/green/blue values are decimal numbers: red=36, green=104, blue=160 (a greyish-blue color). The decimal numbers 36, 104 and 160 are 24, 68 and A0 respectively in hexadecimal notation. To obtain the hex triplet, we simply write the three hex bytes together without spaces, thus: 2468A0. If a byte is less than 16 (decimal) or 10 (hex) it must be represented with a leading zero to keep the number of digits in the triplet equal to six. For example, the decimal triplet 0,1,2 would be represented by the hex triplet 000102.
The number of colors that can be represented by this system is: 256 x 256 x 256 = 16,777,216
There is a very useful color blender that Eric Meyer has up.