There are many ways of representing color values. Probably the most popular in computer graphics is to assign a numeric value to each of three different colors of light which can be displayed by a traditional cathode ray tube such as that of a standard color television. These values for red, green, and blue can also be expressed in several different ways but always represent a level of intensity within the range from none of that color component to the highest brightness available for it.
For those who find hexadecimal numbers less than intuitive, the following two tables are provided. One table lists exact integer conversions from a range of decimal numbers to their hexadecimal equivalents. The other table lists conversions from a range of hexadecimal values to approximate floating-point decimal equivalents based on the division of the integer by the decimal value 255.
Here is the decimal to hexadecimal conversion chart.
|
Range |
Hexadecimal Conversion |
|
0 - 15 |
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |
|
16 - 31 |
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F |
|
32 - 47 |
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F |
|
48 - 63 |
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F |
|
64 - 79 |
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F |
|
80 - 95 |
50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F |
|
96 - 111 |
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F |
|
112 - 127 |
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F |
|
128 - 143 |
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F |
|
144 - 159 |
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F |
|
160 - 175 |
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF |
|
176 - 191 |
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF |
|
192 - 207 |
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF |
|
208 - 223 |
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF |
|
224 - 239 |
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF |
|
240 - 255 |
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF |
Here is the hexadecimal to floating-point conversion chart based on dividing the integer value by decimal 255. Values listed in this chart are rounded leaving enough precision to represent a clear distinction between values for efficient use with the RWX Color command.
|
Range |
Floating-Point Decimal Conversion |
|
00-07 |
0 .003 .007 .01 .015 .019 .02 .027 |
|
08-0F |
.03 .035 .039 .04 .047 .05 .054 .058 |
|
10-17 |
.06 .066 .07 .074 .078 .08 .086 .09 |
|
18-1F |
.094 .098 .1 .105 .109 .11 .117 .12 |
|
20-27 |
.125 .129 .13 .137 .14 .145 .149 .15 |
|
28-2F |
.156 .16 .164 .168 .17 .176 .18 .184 |
|
30-37 |
.188 .19 .196 .2 .203 .207 .21 .215 |
|
38-3F |
.219 .22 .227 .23 .235 .239 .24 .247 |
|
40-47 |
.25 .254 .258 .26 .266 .27 .274 .278 |
|
48-4F |
.28 .286 .29 .294 .298 .3 .305 .309 |
|
50-57 |
.31 .317 .32 .325 .329 .33 .337 .34 |
|
58-5F |
.345 .349 .35 .356 .36 .364 .368 .37 |
|
60-67 |
.376 .38 .384 .388 .39 .396 .4 .403 |
|
68-6F |
.407 .41 .415 .419 .42 .427 .43 .435 |
|
70-77 |
.439 .44 .447 .45 .454 .458 .46 .466 |
|
78-7F |
.47 .474 .478 .48 .486 .49 .494 .498 |
|
80-87 |
.5 .505 .509 .51 .517 .52 .525 .529 |
|
88-8F |
.53 .537 .54 .545 .549 .55 .556 .56 |
|
90-97 |
.564 .568 .57 .576 .58 .584 .588 .59 |
|
98-9F |
.596 .6 .603 .607 .61 .615 .619 .62 |
|
A0-A7 |
.627 .63 .635 .639 .64 .647 .65 .654 |
|
A8-AF |
.658 .66 .666 .67 .674 .678 .68 .686 |
|
B0-B7 |
.69 .694 .698 .7 .705 .709 .71 .717 |
|
B8-BF |
.72 .725 .729 .73 .737 .74 .745 .749 |
|
C0-C7 |
.75 .756 .76 .764 .768 .77 .776 .78 |
|
C8-CF |
.784 .788 .79 .796 .8 .803 .807 .81 |
|
D0-D7 |
.815 .819 .82 .827 .83 .835 .839 .84 |
|
D8-DF |
.847 .85 .854 .858 .86 .866 .87 .874 |
|
E0-E7 |
.878 .88 .886 .89 .894 .898 .9 .905 |
|
E8-EF |
.909 .91 .917 .92 .925 .929 .93 .937 |
|
F0-F7 |
.94 .945 .949 .95 .956 .96 .964 .968 |
|
F8-FF |
.97 .976 .98 .984 .988 .99 .996 1 |
You may notice that the hexadecimal representation is much more concise, which is exactly what makes it so popular.