|
Color Conversion |
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.
The RWX Color command uses a floating-point decimal range from 0 to 1 for each component, and action commands used by Active Worlds builders expect either a pre-defined color name or a string of six characters made up of a two digit integer hexadecimal number in the range from 00 to FF for each of the three components. You may also find while setting colors within various dialog boxes that an integer decimal range from 0 to 255 is often used. The first table on this page lists the pre-defined colors that can be used with some of the action commands along with conversions to the three types of RGB representations just mentioned.
Color Name | = | RWX | Decimal Integer | Hexadecimal |
|---|---|---|---|---|
aquamarine | # | .439 .858 .576 | red=112 green=219 blue=147 | 70DB93 |
black | # | 0 0 0 | red=0 green=0 blue=0 | 000000 |
blue | # | 0 0 1 | red=0 green=0 blue=255 | 0000FF |
brass | # | .709 .65 .258 | red=181 green=166 blue=66 | B5A642 |
bronze | # | .549 .47 .325 | red=140 green=120 blue=83 | 8C7853 |
brown | # | .65 .164 .164 | red=166 green=42 blue=42 | A62A2A |
copper | # | .72 .45 .2 | red=184 green=115 blue=51 | B87333 |
cyan | # | 0 1 1 | red=0 green=255 blue=255 | 00FFFF |
darkgrey | # | .188 .188 .188 | red=48 green=48 blue=48 | 303030 |
forestgreen | # | .137 .556 .137 | red=35 green=142 blue=35 | 238E23 |
gold | # | .803 .498 .196 | red=205 green=127 blue=50 | CD7F32 |
green | # | 0 1 0 | red=0 green=255 blue=0 | 00FF00 |
grey | # | .439 .439 .439 | red=112 green=112 blue=112 | 707070 |
lightgrey | # | .75 .75 .75 | red=192 green=192 blue=192 | C0C0C0 |
magenta | # | 1 0 1 | red=255 green=0 blue=255 | FF00FF |
maroon | # | .556 .137 .419 | red=142 green=35 blue=107 | 8E236B |
navyblue | # | .137 .137 .556 | red=35 green=35 blue=142 | 23238E |
orange | # | 1 .498 0 | red=255 green=127 blue=0 | FF7F00 |
orangered | # | 1 .14 0 | red=255 green=36 blue=0 | FF2400 |
orchid | # | .858 .439 .858 | red=219 green=112 blue=219 | DB70DB |
pink | # | 1 .43 .78 | red=255 green=110 blue=199 | FF6EC7 |
red | # | 1 0 0 | red=255 green=0 blue=0 | FF0000 |
salmon | # | .435 .258 .258 | red=111 green=66 blue=66 | 6F4242 |
scarlet | # | .549 .09 .09 | red=140 green=23 blue=23 | 8C1717 |
silver | # | .9 .909 .98 | red=230 green=232 blue=250 | E6E8FA |
skyblue | # | .196 .6 .8 | red=50 green=153 blue=204 | 3299CC |
tan | # | .858 .576 .439 | red=219 green=147 blue=112 | DB9370 |
teal | # | 0 .439 .439 | red=0 green=112 blue=112 | 007070 |
turquoise | # | .678 .917 .917 | red=173 green=234 blue=234 | ADEAEA |
violet | # | .309 .184 .309 | red=79 green=47 blue=79 | 4F2F4F |
white | # | 1 1 1 | red=255 green=255 blue=255 | FFFFFF |
yellow | # | 1 1 0 | red=255 green=255 blue=0 | FFFF00 |
Click the # link on any of the color samples to find more colors of the same hue.
Numeric conversion
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 |
|
16 - 31 |
|
32 - 47 |
|
48 - 63 |
|
64 - 79 |
|
80 - 95 |
|
96 - 111 |
|
112 - 127 |
|
128 - 143 |
|
144 - 159 |
|
160 - 175 |
|
176 - 191 |
|
192 - 207 |
|
208 - 223 |
|
224 - 239 |
|
240 - 255 |
|
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 |
|---|---|
| 0 .003 .007 .01 .015 .019 .02 .027 |
| .03 .035 .039 .04 .047 .05 .054 .058 |
| .06 .066 .07 .074 .078 .08 .086 .09 |
| .094 .098 .1 .105 .109 .11 .117 .12 |
| .125 .129 .13 .137 .14 .145 .149 .15 |
| .156 .16 .164 .168 .17 .176 .18 .184 |
| .188 .19 .196 .2 .203 .207 .21 .215 |
| .219 .22 .227 .23 .235 .239 .24 .247 |
| .25 .254 .258 .26 .266 .27 .274 .278 |
| .28 .286 .29 .294 .298 .3 .305 .309 |
| .31 .317 .32 .325 .329 .33 .337 .34 |
| .345 .349 .35 .356 .36 .364 .368 .37 |
| .376 .38 .384 .388 .39 .396 .4 .403 |
| .407 .41 .415 .419 .42 .427 .43 .435 |
| .439 .44 .447 .45 .454 .458 .46 .466 |
| .47 .474 .478 .48 .486 .49 .494 .498 |
| .5 .505 .509 .51 .517 .52 .525 .529 |
| .53 .537 .54 .545 .549 .55 .556 .56 |
| .564 .568 .57 .576 .58 .584 .588 .59 |
| .596 .6 .603 .607 .61 .615 .619 .62 |
| .627 .63 .635 .639 .64 .647 .65 .654 |
| .658 .66 .666 .67 .674 .678 .68 .686 |
| .69 .694 .698 .7 .705 .709 .71 .717 |
| .72 .725 .729 .73 .737 .74 .745 .749 |
| .75 .756 .76 .764 .768 .77 .776 .78 |
| .784 .788 .79 .796 .8 .803 .807 .81 |
| .815 .819 .82 .827 .83 .835 .839 .84 |
| .847 .85 .854 .858 .86 .866 .87 .874 |
| .878 .88 .886 .89 .894 .898 .9 .905 |
| .909 .91 .917 .92 .925 .929 .93 .937 |
| .94 .945 .949 .95 .956 .96 .964 .968 |
| .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.