![idl color table idl color table](http://idl.selab.re.kr/wp-content/uploads/2013/04/colortable51.jpg)
Idl color table how to#
If you read the table vertically, however, you can see how to create three vectors: one containing the red values of the five colors, a second containing the green values, and the third containing the blue values of the five colors. Reading the colors horizontally, you see the color triple that makes up each color. You could create a table of these colors and the color triple values associated with each, like this: Well, suppose you wanted to be able to ask for five colors by name: charcoal, red, olive green, blue, and yellow. It would be so much easier if we could ask for the olive greenĬolor by name. If you took this olive green color triple and turned it into a 1-by-3 array, you could load it with TVLCT even more simply, like this:īut, with this kind of code, it is difficult, if not impossible, to tell exactly whatĬolor is being used. The default in IDL is to be in what weĬall "decomposed" color mode, which you will learn about in just a moment. Theĭevice, Decomposed=0 command at the beginning of the commands below To use the olive green color in a plot, you could type something like this. An olive green color is made up of the color triple (53, 156, 83). Suppose you wanted to load an olive green color into color index 100. To use a indexed color in IDL, you must first load a color at a particular color index. You can express a yellow color (a combination of red and green colors) as the triple (255, 255, 0). For example, you can express a red color as the color triple (255, 0, 0). These values range from 0 (none of the color) to 255 (as much of that color as possible). IDL reads the color table at that index and obtains the red, green, and blue values that make up that particular color triple (red, green, blue). The indexed color model uses a color table. This is called an 8-bit or indexed color system or model. Then, we use an index into the 256 values of the color table to select a particular color. Perhaps the most common way, still, even in the 21st century, is to select 256 of the possible 16.7 colors and load them into a color table. There are two different ways we can obtain the RGB triple that makes up a color in IDL. It follows, then, that the color palette we work from contains 256 times 256 times 256, or 16.7 million different colors.
Idl color table full#
Each color can be specified in 256 different "amounts", from no color (value 0) to full color (value 255). These numbers indicate the amount of red, green, and blue to add to a color to make a particular color. That is to say, it takes three numbers to define a color in IDL.
Idl color table code#
To see examples of colorful IDL plots, along with the code that creates them, please visit theĪll colors in IDL are specified by means of an RGB triple. Coyote's Guide to Traditional IDL Graphics.