There are 16,777,216 different colours that can be represented on a typical computer screen, obviously too many to have a useful name for each. One common notation used to represent colours is known as the hexadecimal notation where colours are represented by the octothorpe symbol (#) followed by six digits (from 0 to 9) or letters (from a to f).
The following code gives a few examples:
There are 16,777,216 different colours that can be represented on a typical computer screen. Every colour is a different combination of each of the three primary colours: red, green and blue. Obviously, trying to have a name for each one of them would not be practical. The system that is most often used is to represent each colour by a triplet of numbers, usually written using hexadecimal notation.
Usual numbers are known as decimal which means that they are represented using 10 symbols (0, 1, ..., 9) or in base 10. Hexadecimal numbers are represented using 16 symbols (0, 1, ...., 8, 9, a, b, c, d, e) and are thus in base 16. Note that uppercase and lowercase letters are used interchangeably.
The number 97 in base 10 (decimal notation) is equal to
(9 x 10) + (7 x 1)
The number 97 in base 16 (hexadecimal notation) is equal to
(9 x 16) + (7 x 1)
In decimal notation, the combination of two symbols (including a leading zero) can represent 10 x 10 = 100 different numbers (from 0 to 99). In hexadecimal notation, the combination of two symbols can represent 16 x 16 = 256 different numbers (from 0 to ff).
Using the hexadecimal notation, colours are represented by the octothorpe symbol (#) followed a triplet of hexadecimal numbers, each hexadecimal number represented by a combination of two symbols (from 00 to ff). The first hexadecimal number represents the "shade of" red contributing to the overall colour; the second hexadecimal number is the green component, and the third is the blue component.
For hexadecimal colours that are of the form #xxYYzz, the shortcut notation #xYz is also allowed.
You can view the hexadecimal equivalent of the named colours by
clicking on the image above.
[The following table has been adapted from Wikipedia.]
|
|
|
Keep your personal notes here. These notes are stored by your browser on your own computer, and will be available from any page on this site. You can choose to use html syntax for formatting.