IDL Color Tables: How to get more (and make your own!)

After researching the issue for quite some time I have noticed there aren't really many easily available color table files that you can download to include in your IDL codes. I also noticed that it's actually a little tricky to find out how to make your own. So I've decided to post a small collection of my own color tables with a read in file for people to use!


Download the files here!

CHloadct

CHloadct.pro will read in saved color table files like the normal "loadct" will. It is very simple and includes a reverse command so if you like any of the tables below, (which I use for plotting contours mainly,) then feel free to download the .zip file. To use simply add the CHloadct directory to your IDL path and you're away. 

Use

CHloadct,'SUNSET',/reverse



 for example to load in the sunset table in reverse.




The zip file can be found here and contains the above save files to get you started. If anyone is using this and it's working well please let me know if you could do with more color tables, I'll try to update the files whenever I create any good new ones.

Creating your own Color Tables in IDL

To create color tables you can use a very handy command "xpalette".
In the command line type in xpalette and hit enter and a pop up box will appear. In this box there is a window on the right hand side, filled with the color table you had previously loaded.

Use the controls to alter the colors in each pixel of the window on the right.



It looks daunting but you don't have to do all 256 pixels! Try putting one corner as one color and another as a different color. Use "set mark" on the first pixel, highlight the second colored pixel and click interpolate! You should have a smooth color change.

If your screen starts looking pixelly or isn't updating use "Redraw" to refresh.

When you're done, go back to your command line and type

tvlct,r,g,b,/get

This will grab the rgb values of the color table you've created. Then, to save them do something like:

save,r,g,b,filename='BLUE-RED.sav'

And save the file in the CHloadct directory. (This will allow you to load it up like all the rest!) That should be it! Enjoy your new color table!